1 | #include "object.hpp" |
---|
2 | |
---|
3 | namespace xios |
---|
4 | { |
---|
5 | /// ////////////////////// Définitions ////////////////////// /// |
---|
6 | |
---|
7 | CObject::CObject(void) |
---|
8 | : id(), idDefined(false), idAutoGenerated(false) |
---|
9 | { /* Ne rien faire de plus */ } |
---|
10 | |
---|
11 | CObject::CObject(const StdString& id, bool idAutoGenerated /*= false*/) |
---|
12 | : id(id) |
---|
13 | , idDefined(true) |
---|
14 | , idAutoGenerated(idAutoGenerated) |
---|
15 | { /* Ne rien faire de plus */ } |
---|
16 | |
---|
17 | CObject::CObject(const CObject& object) |
---|
18 | : id(object.id) |
---|
19 | , idDefined(object.idDefined) |
---|
20 | , idAutoGenerated(object.idAutoGenerated) |
---|
21 | { /* Ne rien faire de plus */ } |
---|
22 | |
---|
23 | CObject::~CObject(void) |
---|
24 | { /* Ne rien faire de plus */ } |
---|
25 | |
---|
26 | const StdString& CObject::getId(void) const |
---|
27 | { |
---|
28 | return this->id; |
---|
29 | } |
---|
30 | |
---|
31 | const StdString& CObject::getIdServer() const |
---|
32 | { |
---|
33 | return this->id; |
---|
34 | } |
---|
35 | |
---|
36 | StdString CObject::dumpClassAttributes(void) |
---|
37 | { |
---|
38 | return ""; |
---|
39 | } |
---|
40 | |
---|
41 | bool CObject::hasId(void) const |
---|
42 | { |
---|
43 | return this->idDefined; |
---|
44 | } |
---|
45 | |
---|
46 | bool CObject::hasAutoGeneratedId(void) const |
---|
47 | { |
---|
48 | return this->idAutoGenerated; |
---|
49 | } |
---|
50 | |
---|
51 | void CObject::resetId(void) |
---|
52 | { |
---|
53 | this->idDefined = false; |
---|
54 | } |
---|
55 | |
---|
56 | void CObject::setId(const StdString& id, bool idAutoGenerated /*= false*/) |
---|
57 | { |
---|
58 | this->id = id; |
---|
59 | this->idDefined = true; |
---|
60 | this->idAutoGenerated = idAutoGenerated; |
---|
61 | } |
---|
62 | |
---|
63 | /* |
---|
64 | bool CObject::operator==(const CObject& other) const |
---|
65 | { |
---|
66 | if(!this->hasId() || !other.hasId()) |
---|
67 | return false; |
---|
68 | return this->id.compare(other.id) == 0; |
---|
69 | } |
---|
70 | |
---|
71 | bool CObject::operator!=(const CObject& other) const |
---|
72 | { |
---|
73 | return !(*this == other); |
---|
74 | } |
---|
75 | */ |
---|
76 | |
---|
77 | StdOStream& operator<<(StdOStream& os, const CObject& object) |
---|
78 | { |
---|
79 | os << object.toString(); |
---|
80 | return os; |
---|
81 | } |
---|
82 | } // namespace xios |
---|