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