object.hpp 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. #ifndef __XIOS_CObject__
  2. #define __XIOS_CObject__
  3. /// XIOS headers ///
  4. #include "xios_spl.hpp"
  5. namespace xios
  6. {
  7. /// ////////////////////// Déclarations ////////////////////// ///
  8. class CObject
  9. {
  10. public:
  11. /// Destructeur ///
  12. virtual ~CObject(void);
  13. /// Accesseurs ///
  14. const StdString& getId(void) const;
  15. virtual const StdString& getIdServer() const;
  16. /// Mutateurs ///
  17. void resetId(void);
  18. void setId(const StdString& id, bool idAutoGenerated = false);
  19. /// Tests ///
  20. bool hasId(void) const;
  21. bool hasAutoGeneratedId(void) const;
  22. /// Opérateurs ///
  23. // bool operator==(const CObject& other) const;
  24. // bool operator!=(const CObject& other) const;
  25. /// Flux ///
  26. friend StdOStream& operator<<(StdOStream& os, const CObject& object);
  27. /// Autres ///
  28. virtual StdString toString(void) const = 0;
  29. virtual void fromString(const StdString& str) = 0;
  30. protected:
  31. /// Constructeurs ///
  32. CObject(void);
  33. explicit CObject(const StdString& id, bool idAutoGenerated = false);
  34. CObject(const CObject& object);
  35. CObject(const CObject* const object); // Not implemented.
  36. private:
  37. /// Propriétés ///
  38. StdString id; // identifiant de l'Object
  39. bool idDefined; // true si l'object est identifié, false sinon.
  40. bool idAutoGenerated; //!< true if and only the id was automatically generated
  41. }; // class CObject
  42. } // namespace xios
  43. #endif // __XIOS_CObject__