blob: 853fd5d86d3a3a0febd886deb3be5fffe18783c3 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
|
#ifndef ZOO_ANIMAL
#define ZOO_ANIMAL
#include <string>
#include <utility>
#include "Zoo.hh"
namespace zoo {
/**
* @brief Used to store the identification number, cage number where the animal
* is kept, species of animal, and date of acquisition
*/
class ZooAnimal {
private:
int idNumber;
int cageNumber;
int dateAcquired;
[[maybe_unused]] int padding;
std::string species;
Zoo *zoo;
public:
explicit ZooAnimal(int _idNumber = 0, int _cageNumber = 0,
int _dateAcquired = 0, std::string _species = "",
Zoo *_zoo = nullptr)
: idNumber(_idNumber), cageNumber(_cageNumber),
dateAcquired(_dateAcquired), padding(0), species(std::move(_species)),
zoo(_zoo) {}
virtual ~ZooAnimal();
/**
* @brief Set the ID number of a zoo animal
*/
void setIDNum(int);
/**
* @brief Set the cage number of a zoo animal
*/
void setCageNum(int);
/**
* @brief Set the date of acquisition of a zoo animal
*/
void setDateAcq(int);
/**
* @brief Set the species of a zoo animal
*/
void setSpecies(std::string);
/**
* @brief Get the ID number of a zoo animal
*/
[[nodiscard]] int getIDNum() const;
/**
* @brief Get the cage number of a zoo animal
*/
[[nodiscard]] int getCageNum() const;
/**
* @brief Get the date of acquisition of a zoo animal
*/
[[nodiscard]] int getDateAcq() const;
/**
* @brief Get the species of a zoo animal
*/
std::string getSpecies();
private:
bool validateCageNumber(int);
};
} // namespace zoo
#endif // ZOO_ANIMAL
|