HatchKeeper  0.90
The Free Open-Source Egg Incubation Software
Batch.h
Go to the documentation of this file.
1 /******************************************************************/
8 #ifndef _BATCH_H__
9 #define _BATCH_H__
10 
11 #include "../headers/Date.h"
12 #include "../headers/Advanced.h"
13 
22 class HK_Batch {
23  private:
25  string HK_BatchName;
26  string HK_BatchType;
27  string HK_BatchBreed;
28  string HK_BatchGroup;
31 
35 
40 
44  public:
45  HK_Batch();
46 
47  HK_Batch(int ID, string Name, string Type,
48  string Breed, string Group, string Comments, string Incubator,
49  int Eggs, int Fertile, int Chicks,
50  HK_Date Start, HK_Date Candle, HK_Date Lockdown, HK_Date Hatch,
51  int Remind, int Adv
52  );
53 
54  ~HK_Batch();
55 
56  int GetID();
57  string GetName();
58  string GetType();
59  string GetBreed();
60  string GetGroup();
61  string GetComments();
62  string GetIncubator();
63  int GetEggs();
64  int GetFertile();
65  int GetChicks();
66  HK_Date GetStart();
69  HK_Date GetHatch();
70  int GetRemind();
71  int GetAdv();
73  vector<string> GetSQL();
74  vector<string> GetSQL(int ID);
75  vector<string> GetUpdate();
76 
77  int GetDaysLeft();
78  int OnDay();
79 
80  HK_KeyValue Search(string Value, bool SearchBatches, bool SearchAdv);
81  void Set(int ID, string Name, string Type,
82  string Breed, string Group, string Comments,string Incubator,
83  int Eggs, int Fertile, int Chicks,
84  HK_Date Start, HK_Date Candle, HK_Date Lockdown, HK_Date Hatch,
85  int Remind, int Adv
86  );
87  void SetID(int ID);
88  void SetName(string Name);
89  void SetType(string Type);
90  void SetBreed(string Breed);
91  void SetGroup(string Group);
92  void SetComments(string Comments);
93  void SetIncubator(string Incubator);
94  void SetEggs(int Eggs);
95  void SetFertile(int Fertile);
96  void SetChicks(int Chicks);
97  void SetStart(HK_Date Start);
98  void SetCandle(HK_Date Candle);
99  void SetLockdown(HK_Date Lockdown);
100  void SetHatch(HK_Date Hatch);
101  void SetRemind(int Remind);
102  void SetAdv(int Adv);
103  void SetAdvanced(HK_Advanced Adv);
104  void SetAdvEgg(HK_Egg Egg, int Select);
105  void SetAdvUpdate(bool Status);
106 
107  int CalculatePercent(int First, int Second);
108  int PercentFertile();
109  int PercentOfFertile();
110  int PercentOfTotal();
111  int FertileUnhatched();
113 };
114 
115 #endif
HK_Storage Remind
Definition: Declare.h:40
A Class For Managing Multiple HK_Egg Instances.
Definition: Advanced.h:20
Holds Data For One Batch, Includes Basic Set/Get Methods.
Definition: Batch.h:22
int PercentOfTotal()
Returns The Percentage Of Total Eggs That Hatched.
Definition: HK_Batch.cpp:290
void SetAdv(int Adv)
Sets Batch Advanced Status.
Definition: HK_Batch.cpp:130
int PercentFertile()
Returns The Percentage Of Eggs That Were Fertile.
Definition: HK_Batch.cpp:278
void SetID(int ID)
Sets Batch ID.
Definition: HK_Batch.cpp:100
void SetAdvanced(HK_Advanced Adv)
Sets Batch Advanced Data.
Definition: HK_Batch.cpp:132
int HK_BatchFertile
Definition: Batch.h:33
void SetCandle(HK_Date Candle)
Sets Batch Candle Date.
Definition: HK_Batch.cpp:122
int GetChicks()
Returns Number Of Hatched Eggs In Batch, If Advanced Is Enabled It Returns HK_Advanced::GetChicks()
Definition: HK_Batch.cpp:166
string HK_BatchBreed
Definition: Batch.h:27
HK_Date GetCandle()
Returns Batch Candle Date.
Definition: HK_Batch.cpp:177
HK_Date HK_BatchLockdown
Definition: Batch.h:38
int HK_BatchChicks
Definition: Batch.h:34
HK_Advanced HK_BatchAdvanced
Definition: Batch.h:43
vector< string > GetSQL()
Returns An SQL String To Set Batch In Database.
Definition: HK_Batch.cpp:190
string GetName()
Returns Batch Name.
Definition: HK_Batch.cpp:142
int GetFertile()
Returns Number Of Fertile Eggs In Batch, If Advanced Is Enabled It Returns HK_Advanced::GetFertile()
Definition: HK_Batch.cpp:157
void Set(int ID, string Name, string Type, string Breed, string Group, string Comments, string Incubator, int Eggs, int Fertile, int Chicks, HK_Date Start, HK_Date Candle, HK_Date Lockdown, HK_Date Hatch, int Remind, int Adv)
Sets All Batch Data In One Function.
Definition: HK_Batch.cpp:75
void SetFertile(int Fertile)
Sets Batch Fertile Eggs.
Definition: HK_Batch.cpp:116
HK_Batch()
Default Constructor.
Definition: HK_Batch.cpp:11
void SetName(string Name)
Sets Batch Name.
Definition: HK_Batch.cpp:102
HK_Date GetStart()
Returns Batch Start Date.
Definition: HK_Batch.cpp:175
string GetIncubator()
Returns The Incubator As A String.
Definition: HK_Batch.cpp:152
vector< string > GetUpdate()
Returns A String That Updates This Batch In Database.
Definition: HK_Batch.cpp:210
string GetGroup()
Returns Batch Group.
Definition: HK_Batch.cpp:148
void SetRemind(int Remind)
Sets Batch Remind Status For Notifications.
Definition: HK_Batch.cpp:128
int OnDay()
Returns The Number Of Days Left In Incubation Period.
Definition: HK_Batch.cpp:266
int GetEggs()
Returns Number Of Eggs In Batch.
Definition: HK_Batch.cpp:154
void SetType(string Type)
Sets Batch Type.
Definition: HK_Batch.cpp:104
void SetIncubator(string Incubator)
Sets Batch Incubator.
Definition: HK_Batch.cpp:112
HK_Date GetLockdown()
Returns Batch Lockdown Date.
Definition: HK_Batch.cpp:179
void SetAdvEgg(HK_Egg Egg, int Select)
Sets The Selected Egg For HK_Advanced.
Definition: HK_Batch.cpp:134
string HK_BatchComments
Definition: Batch.h:29
void SetChicks(int Chicks)
Sets Batch Hatched Eggs.
Definition: HK_Batch.cpp:118
void SetComments(string Comments)
Sets Batch Comments.
Definition: HK_Batch.cpp:110
int HK_BatchRemind
Definition: Batch.h:41
string GetComments()
Returns Batch Comments.
Definition: HK_Batch.cpp:150
int GetRemind()
Returns Batch Remind Status.
Definition: HK_Batch.cpp:183
HK_Date HK_BatchHatch
Definition: Batch.h:39
void SetBreed(string Breed)
Sets Batch Breed.
Definition: HK_Batch.cpp:106
int GetDaysLeft()
Returns The Number Of Days Left In Incubation Period.
Definition: HK_Batch.cpp:254
~HK_Batch()
Destructor.
Definition: HK_Batch.cpp:25
int FertileUnhatched()
Returns The Number Of Fertile Eggs That Didn't Hatch.
Definition: HK_Batch.cpp:296
HK_Date HK_BatchStart
Definition: Batch.h:36
int HK_BatchAdv
Definition: Batch.h:42
string GetBreed()
Returns Batch Breed.
Definition: HK_Batch.cpp:146
void SetHatch(HK_Date Hatch)
Sets Batch Hatch Date.
Definition: HK_Batch.cpp:126
string HK_BatchName
Definition: Batch.h:25
void SetEggs(int Eggs)
Sets Batch Eggs.
Definition: HK_Batch.cpp:114
int PercentOfTotalUnhatched()
Returns The Percentage Of Total Eggs That Didn't Hatch.
Definition: HK_Batch.cpp:302
int PercentOfFertile()
Returns The Percentage Of Fertile Eggs That Hatched.
Definition: HK_Batch.cpp:284
void SetAdvUpdate(bool Status)
Sets The Update Status HK_Advanced.
Definition: HK_Batch.cpp:136
string HK_BatchType
Definition: Batch.h:26
void SetStart(HK_Date Start)
Sets Batch Start Date.
Definition: HK_Batch.cpp:120
int GetID()
Returns Batch ID.
Definition: HK_Batch.cpp:140
HK_Advanced GetAdvanced()
Returns Batch Advanced Egg Data.
Definition: HK_Batch.cpp:187
int GetAdv()
Returns Batch Advanced Status.
Definition: HK_Batch.cpp:185
string GetType()
Returns Batch Type.
Definition: HK_Batch.cpp:144
void SetLockdown(HK_Date Lockdown)
Sets Batch Lockdown Date.
Definition: HK_Batch.cpp:124
HK_KeyValue Search(string Value, bool SearchBatches, bool SearchAdv)
Searches For Value And Returns HK_KeyValue With Data.
Definition: HK_Batch.cpp:28
string HK_BatchGroup
Definition: Batch.h:28
void SetGroup(string Group)
Sets Batch Group.
Definition: HK_Batch.cpp:108
HK_Date GetHatch()
Returns Batch Hatch Date.
Definition: HK_Batch.cpp:181
int CalculatePercent(int First, int Second)
Returns The Percentage Of Two Ints.
Definition: HK_Batch.cpp:241
int HK_BatchEggs
Definition: Batch.h:32
HK_Date HK_BatchCandle
Definition: Batch.h:37
int HK_BatchID
Definition: Batch.h:24
string HK_BatchIncubator
Definition: Batch.h:30
A Class For Managing Dates.
Definition: Date.h:25
A Class For Storing And Retieving Data For One Egg.
Definition: Egg.h:24
A Key and Value Type Storage.
Definition: KeyValue.h:25