HatchKeeper  0.90
The Free Open-Source Egg Incubation Software
Batches.h
Go to the documentation of this file.
1 /*******************************************************************/
9 #ifndef _BATCHES_H__
10 #define _BATCHES_H__
11 
12 #include "../headers/Batch.h"
13 #include <vector>
14 
22 class HK_Batches{
23  private:
24  vector<HK_Batch> HK_BatchInstance;
25  vector<bool> HK_BatchDirty;
26  public:
27  HK_Batches();
28 
29  void Add(HK_Batch Batch);
30  void Add(int ID, string Name, string Type,
31  string Breed, string Group, string Comments,string Incubator,
32  int Eggs, int Fertile, int Chicks,
33  HK_Date Start, HK_Date Candle, HK_Date Lockdown, HK_Date Hatch,
34  int Remind, int Adv
35  );
36 
37  bool AddAdvanced(HK_Advanced Adv);
38  int AvgFertile();
39  int AvgFertileHatch();
40  int AvgTotalHatch();
41  int AvgTotalUnHatch();
42 
43  void Clear();
44 
45  int GetAdv(int Select);
46  HK_Advanced GetAdvanced(int Select);
47  HK_Batch GetBatch(int Select);
48  string GetBreed(int Select);
49  HK_Date GetCandle(int Select);
50  int GetChicks(int Select);
51  string GetComments(int Select);
52  int GetCount();
53  int GetEggs(int Select);
54  int GetFertile(int Select);
55  string GetGroup(int Select);
56  HK_Date GetHatch(int Select);
57  int GetID(int Select);
58  string GetIncubator(int Select);
59  HK_Date GetLockdown(int Select);
60  string GetName(int Select);
61  int GetRemind(int Select);
62  vector<string> GetSQL(int Select, int ID);
63  HK_Date GetStart(int Select);
64  string GetType(int Select);
65  int GetValidID();
66 
67  bool IsDirty(int Select);
68  bool IsValidName(string Name);
69 
70  int PercentFertile(int Select);
71  int PercentOfFertile(int Select);
72  int PercentOfTotal(int Select);
73  int PercentOfTotalUnhatched(int Select);
74  int FertileUnhatched(int Select);
75 
76 
77 
78 
79  HK_KeyValue Search(string Value, bool SearchBatch, bool SearchAdv);
80  void SetAdvEgg(int Select, HK_Egg Egg, int EggSelect);
81  void SetAdvUpdate(int Select, bool Status);
82  void SetBatch(int Select, HK_Batch Batch);
83  void SetClean(int Select);
84  void SetDirty(int Select);
85 
86  int TotalEggs();
87  int TotalChicks();
88 };
89 
90 #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
A Class For Managing Mulitple HK_Batch Objects.
Definition: Batches.h:22
HK_Advanced GetAdvanced(int Select)
Returns Advanced Egg Data Selected Batch.
Definition: HK_Batches.cpp:93
HK_Date GetHatch(int Select)
Returns Hatch Date For Selected Batch.
Definition: HK_Batches.cpp:87
void Clear()
Clears All Batches.
Definition: HK_Batches.cpp:226
int GetID(int Select)
Returns Batch ID For Selected Batch.
Definition: HK_Batches.cpp:61
void SetDirty(int Select)
Sets Dirty Mark For Selected Batch.
Definition: HK_Batches.cpp:261
int PercentOfTotalUnhatched(int Select)
Returns The Percentage Of Total Eggs That Didn't Hatch For The Selected Batch.
Definition: HK_Batches.cpp:129
vector< bool > HK_BatchDirty
Definition: Batches.h:25
HK_Date GetStart(int Select)
Returns Start Date For Selected Batch.
Definition: HK_Batches.cpp:81
void Add(HK_Batch Batch)
Adds Another HK_Batch.
Definition: HK_Batches.cpp:15
void SetClean(int Select)
Clears Dirty Mark For Selected Batch.
Definition: HK_Batches.cpp:259
int AvgTotalUnHatch()
Returns Average Percentage Of Total Eggs That Did Not Hatch In This HK_Batches Instance.
Definition: HK_Batches.cpp:181
int AvgFertileHatch()
Returns Average Percentage Of Fertile Eggs That Hatched In This HK_Batches Instance.
Definition: HK_Batches.cpp:172
string GetIncubator(int Select)
Returns Batch Incubator For Selected Batch.
Definition: HK_Batches.cpp:73
void SetAdvUpdate(int Select, bool Status)
Sets The Update Status HK_Advanced.
Definition: HK_Batches.cpp:250
int GetAdv(int Select)
Returns Advanced Status For Selected Batch.
Definition: HK_Batches.cpp:91
int GetValidID()
Returns An ID That Isn't Used By Any HK_Batch In This HK_Batches Instance.
Definition: HK_Batches.cpp:194
int AvgFertile()
Returns Average Percentage Of Eggs Fertile In This HK_Batches Instance.
Definition: HK_Batches.cpp:154
void SetBatch(int Select, HK_Batch Batch)
Replaces Batch In Selected Position In Array. Use Add() To Add A Batch.
Definition: HK_Batches.cpp:253
int GetChicks(int Select)
Returns Number Of Hatched Eggs For Selected Batch.
Definition: HK_Batches.cpp:79
bool IsDirty(int Select)
Returns True If Batch Has Dirty Mark Set.
Definition: HK_Batches.cpp:102
int GetFertile(int Select)
Returns Number Of Fertile Eggs For Selected Batch.
Definition: HK_Batches.cpp:77
bool AddAdvanced(HK_Advanced Adv)
Add Advanced Data To The Batch That Has A Matching ID.
Definition: HK_Batches.cpp:38
int PercentOfTotal(int Select)
Returns The Percentage Of Total Eggs That Hatched For The Selected Batch.
Definition: HK_Batches.cpp:117
HK_Date GetCandle(int Select)
Returns Candle Date For Selected Batch.
Definition: HK_Batches.cpp:83
int TotalEggs()
Returns Total Number Of Eggs In This HK_Batches Instance.
Definition: HK_Batches.cpp:136
string GetType(int Select)
Returns Batch Type For Selected Batch.
Definition: HK_Batches.cpp:65
vector< string > GetSQL(int Select, int ID)
Returns SQL String(s) To Set Batch In Database For Selected Batch.
Definition: HK_Batches.cpp:96
HK_KeyValue Search(string Value, bool SearchBatch, bool SearchAdv)
Returned HK_KeyValue's Key Holds Name And Value Holds String Where Match Was Found.
Definition: HK_Batches.cpp:233
int AvgTotalHatch()
Returns Average Percentage Of Total Eggs That Hatched In This HK_Batches Instance.
Definition: HK_Batches.cpp:163
HK_Batch GetBatch(int Select)
Returns The Selected Batch.
Definition: HK_Batches.cpp:55
bool IsValidName(string Name)
Returns True If Name Isn't Already In Use.
Definition: HK_Batches.cpp:216
string GetGroup(int Select)
Returns Batch Group For Selected Batch.
Definition: HK_Batches.cpp:69
vector< HK_Batch > HK_BatchInstance
Definition: Batches.h:24
void SetAdvEgg(int Select, HK_Egg Egg, int EggSelect)
Sets The Selected Egg For HK_Advanced.
Definition: HK_Batches.cpp:244
int GetEggs(int Select)
Returns Number Of Eggs For Selected Batch.
Definition: HK_Batches.cpp:75
int PercentFertile(int Select)
Returns The Percentage Of Egg That Were Fertile For The Selected Batch.
Definition: HK_Batches.cpp:105
int GetCount()
Returns The Number Of Batches Stored.
Definition: HK_Batches.cpp:191
int PercentOfFertile(int Select)
Returns The Percentage Of Fertile Eggs That Hatched For The Selected Batch.
Definition: HK_Batches.cpp:111
int FertileUnhatched(int Select)
Returns The Number Of Fertile Eggs That Didn't Hatch For The Selected Batch.
Definition: HK_Batches.cpp:123
HK_Date GetLockdown(int Select)
Returns Lockdown Date For Selected Batch.
Definition: HK_Batches.cpp:85
int GetRemind(int Select)
Returns Remind Status For Selected Batch.
Definition: HK_Batches.cpp:89
string GetComments(int Select)
Returns Batch Comments For Selected Batch.
Definition: HK_Batches.cpp:71
int TotalChicks()
Returns Total Number Of Chicks In This HK_Batches Instance.
Definition: HK_Batches.cpp:145
string GetName(int Select)
Returns Batch Name For Selected Batch.
Definition: HK_Batches.cpp:63
string GetBreed(int Select)
Returns Batch Breed For Selected Batch.
Definition: HK_Batches.cpp:67
HK_Batches()
Default Constructor.
Definition: HK_Batches.cpp:12
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