From 45db82f0d5c1f5a69073609ad01a902b5151cffe Mon Sep 17 00:00:00 2001 From: Andrew Lalis Date: Mon, 12 Feb 2018 16:27:24 +0100 Subject: [PATCH] Added variables to unit of measure. --- model/recipe/ingredients/ingredient.h | 3 ++- model/recipe/ingredients/recipeingredient.h | 4 ++++ model/recipe/ingredients/unitofmeasure.h | 7 ++++--- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/model/recipe/ingredients/ingredient.h b/model/recipe/ingredients/ingredient.h index 1b58c49..5aace81 100644 --- a/model/recipe/ingredients/ingredient.h +++ b/model/recipe/ingredients/ingredient.h @@ -6,7 +6,8 @@ using namespace std; /** - * @brief The Ingredient class represents an ingredient, which is classified by a food group, and has a name and an ID. An ingredient cannot be included on its own in a recipe, and must be paired with a Unit in a RecipeIngredient Object. + * @brief The Ingredient class represents an ingredient, which is classified by a food group, and has a name and an ID. + * An ingredient cannot be included on its own in a recipe, and must be paired with a Unit in a RecipeIngredient Object. */ class Ingredient diff --git a/model/recipe/ingredients/recipeingredient.h b/model/recipe/ingredients/recipeingredient.h index be5369d..486b5a5 100644 --- a/model/recipe/ingredients/recipeingredient.h +++ b/model/recipe/ingredients/recipeingredient.h @@ -7,6 +7,10 @@ using namespace std; +/** + * @brief The RecipeIngredient class represents both an ingredient and a unit of measure, to be used in a recipe object. + */ + class RecipeIngredient : public Ingredient { public: diff --git a/model/recipe/ingredients/unitofmeasure.h b/model/recipe/ingredients/unitofmeasure.h index 988618d..89bc010 100644 --- a/model/recipe/ingredients/unitofmeasure.h +++ b/model/recipe/ingredients/unitofmeasure.h @@ -14,9 +14,10 @@ class UnitOfMeasure public: UnitOfMeasure(); private: - string name; - string plural; - string abbreviation; + string name; //The name of the unit of measure. + string plural; //The plural name. + string abbreviation; //A short version of the unit. + float siBaseUnitEquivalent; //The ratio when compared to the base SI unit for this unit. For example: 1 cup = 237mL. }; #endif // UNITOFMEASURE_H