HatchKeeper  0.90
The Free Open-Source Egg Incubation Software
Egg.h
Go to the documentation of this file.
1 /*******************************************************************/
8 #ifndef _EGG_H__
9 #define _EGG_H__
10 
11 #include "Date.h"
12 #include "Weight.h"
13 #include "KeyValue.h"
14 #include <vector>
15 #include <algorithm>
16 
24 class HK_Egg {
25  private:
26  string HK_Tag1;
27  string HK_Tag2;
28  string HK_Tag3;
29  int HK_Fertile;
30  int HK_Pipped;
31  int HK_Result;
33  string HK_Comments;
34  vector<HK_Weight> HK_DayWeight;
35  vector<string> HK_DayComment;
36  public:
37  HK_Egg();
38 
39  void ClearDayData();
40  int CalcDayLoss(int Day);
41  int CalcTotalLoss();
42 
43  string GetTag1();
44  string GetTag2();
45  string GetTag3();
46  int GetFertile();
47  int GetPipped();
48  int GetResult();
49  HK_Date GetDate();
50  int GetDays();
51  string GetComments();
52  vector<HK_Weight> GetDayWeight();
53  vector<string> GetDayComments();
54 
55  HK_KeyValue Search(string Value, string BatchName, int Egg);
56  void Set(
57  string Tag1,
58  string Tag2,
59  string Tag3,
60  int Fertile,
61  int Pipped,
62  int Result,
63  HK_Date Date,
64  string Comments,
65  vector<HK_Weight> DayWeight,
66  vector<string> DayComments
67  );
68 
69  void SetTag1(string Tag);
70  void SetTag2(string Tag);
71  void SetTag3(string Tag);
72  void SetFertile(int Fertile);
73  void SetPipped(int Pipped);
74  void SetResult(int Result);
75  void SetDate(HK_Date Date);
76  void SetComments(string Comments);
77  void SetDayWeight(vector<HK_Weight> Weight);
78  void AddDayWeight(HK_Weight Weight);
79  void SetDayComments(vector<string> Comments);
80  void AddDayComments(string Comments);
81 };
82 
83 #endif
Declares HK_KeyValue And Derivative Classes.
Declare HK_Batches Class Methods.
A Class For Managing Dates.
Definition: Date.h:25
A Class For Storing And Retieving Data For One Egg.
Definition: Egg.h:24
int GetResult()
Returns -1 If No Result, 0 If Hatched, And 2 If Egg Quit.
Definition: HK_Egg.cpp:58
string GetComments()
Returns Egg Comments.
Definition: HK_Egg.cpp:64
HK_Date HK_ResultDate
Holds Result Date.
Definition: Egg.h:32
int CalcDayLoss(int Day)
Returns The Percentage Of Weight Lost From Previous Weighing.
Definition: HK_Egg.cpp:24
void SetDayWeight(vector< HK_Weight > Weight)
Sets Weight For All Days.
Definition: HK_Egg.cpp:153
int HK_Fertile
0 == Unfertile, 1 == Fertile
Definition: Egg.h:29
void SetDate(HK_Date Date)
Sets Result Date.
Definition: HK_Egg.cpp:149
string HK_Comments
Holds Comments For Egg.
Definition: Egg.h:33
int HK_Result
-1 == No Result, 0 == Quit, 1 == Hatched
Definition: Egg.h:31
void SetComments(string Comments)
Sets Egg Comments.
Definition: HK_Egg.cpp:151
int GetDays()
Returns The Number Of Days For This Egg.
Definition: HK_Egg.cpp:62
string GetTag2()
Returns Tag 2 As A String.
Definition: HK_Egg.cpp:50
void Set(string Tag1, string Tag2, string Tag3, int Fertile, int Pipped, int Result, HK_Date Date, string Comments, vector< HK_Weight > DayWeight, vector< string > DayComments)
Sets All Data In One Function.
Definition: HK_Egg.cpp:111
int CalcTotalLoss()
Returns The Total Percentage Of Weight Lost By This Egg.
Definition: HK_Egg.cpp:38
vector< string > HK_DayComment
Holds 1 Comment per day.
Definition: Egg.h:35
void SetResult(int Result)
Sets Result Status.
Definition: HK_Egg.cpp:147
string HK_Tag3
Holds Tag 3 For Egg.
Definition: Egg.h:28
HK_Date GetDate()
Returns The Date For The Result.
Definition: HK_Egg.cpp:60
string GetTag3()
Returns Tag 3 As A String.
Definition: HK_Egg.cpp:52
vector< HK_Weight > HK_DayWeight
Holds 1 weight per day.
Definition: Egg.h:34
string HK_Tag1
Holds Tag 1 For Egg.
Definition: Egg.h:26
void SetTag3(string Tag)
Sets The Third Tag.
Definition: HK_Egg.cpp:141
void SetTag1(string Tag)
Sets The First Tag.
Definition: HK_Egg.cpp:137
HK_Egg()
Default Constructor.
Definition: HK_Egg.cpp:12
void SetFertile(int Fertile)
Sets Fertile Status.
Definition: HK_Egg.cpp:143
vector< string > GetDayComments()
Returns An Array Containing A Comment For Every Day.
Definition: HK_Egg.cpp:68
string HK_Tag2
Holds Tag 2 For Egg.
Definition: Egg.h:27
void ClearDayData()
Clears And Shrinks The Day Data Arrays.
Definition: HK_Egg.cpp:15
void AddDayWeight(HK_Weight Weight)
Adds Weight For Another Day.
Definition: HK_Egg.cpp:155
void AddDayComments(string Comments)
Adds Comments For Another Day.
Definition: HK_Egg.cpp:159
vector< HK_Weight > GetDayWeight()
Returns An Array Containing A Weight For Every Day.
Definition: HK_Egg.cpp:66
void SetPipped(int Pipped)
Sets Pip Status.
Definition: HK_Egg.cpp:145
void SetTag2(string Tag)
Sets The Second Tag.
Definition: HK_Egg.cpp:139
int GetPipped()
Returns 0 If Egg Is Not Pipped And 1 If It Is.
Definition: HK_Egg.cpp:56
string GetTag1()
Returns Tag 1 As A String.
Definition: HK_Egg.cpp:48
HK_KeyValue Search(string Value, string BatchName, int Egg)
Searches This Egg For Matches To Value.
Definition: HK_Egg.cpp:71
int GetFertile()
Returns 0 If Egg Is Not Fertile And 1 If It Is.
Definition: HK_Egg.cpp:54
void SetDayComments(vector< string > Comments)
Sets Comments For All Days.
Definition: HK_Egg.cpp:157
int HK_Pipped
0 == Unpipped, 1 == Pipped
Definition: Egg.h:30
A Key and Value Type Storage.
Definition: KeyValue.h:25
A Class For Managing Data For One Weight.
Definition: Weight.h:24