-
Notifications
You must be signed in to change notification settings - Fork 0
/
misao.hpp
50 lines (46 loc) · 933 Bytes
/
misao.hpp
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
#include "osoba.hpp"
template <typename T>
class Misao
{
private:
T misao;
Osoba *osoba;
public:
Misao(T misao, Osoba *osoba) : misao(misao), osoba(osoba) {}
Misao(T misao) : Misao(misao, nullptr) {}
Misao() : Misao("") {}
~Misao() {}
void info()
{
std::cout << "Misao: " << misao << std::endl;
if (osoba != nullptr)
{
std::cout << "Pripada osobi: " << std::endl;
osoba->info();
}
else
std::cout << "Ne pripada ikakvoj osobi." << std::endl;
}
void setOsoba(Osoba *osoba)
{
this->osoba = osoba;
}
Osoba *getOsoba()
{
return osoba;
}
T getMisao()
{
return misao;
}
void setMisao(T misao)
{
this->misao = misao;
}
bool operator==(Misao &m)
{
if (misao == m.getMisao())
return true;
return false;
}
};