source: XIOS/trunk/src/object.hpp @ 1314

Last change on this file since 1314 was 769, checked in by rlacroix, 8 years ago

Keep track of whether an object id was automatically generated or not.

  • Property copyright set to
    Software name : XIOS (Xml I/O Server)
    http://forge.ipsl.jussieu.fr/ioserver
    Creation date : January 2009
    Licence : CeCCIL version2
    see license file in root directory : Licence_CeCILL_V2-en.txt
    or http://www.cecill.info/licences/Licence_CeCILL_V2-en.html
    Holder : CEA/LSCE (Laboratoire des Sciences du CLimat et de l'Environnement)
    CNRS/IPSL (Institut Pierre Simon Laplace)
    Project Manager : Yann Meurdesoif
    yann.meurdesoif@cea.fr
File size: 1.5 KB
RevLine 
[591]1#ifndef __XIOS_CObject__
2#define __XIOS_CObject__
[219]3
[591]4/// XIOS headers ///
5#include "xios_spl.hpp"
[219]6
[335]7namespace xios
[219]8{
[769]9  /// ////////////////////// Déclarations ////////////////////// ///
[219]10
[769]11  class CObject
12  {
13    public:
14      /// Destructeur ///
15      virtual ~CObject(void);
[219]16
[769]17      /// Accesseurs ///
18      const StdString& getId(void) const;
[219]19
[769]20      virtual const StdString& getIdServer() const;
[219]21
[769]22      /// Mutateurs ///
23      void resetId(void);
24      void setId(const StdString& id, bool idAutoGenerated = false);
[511]25
[769]26      /// Tests ///
27      bool hasId(void) const;
28      bool hasAutoGeneratedId(void) const;
[219]29
[769]30      /// Opérateurs ///
31      // bool operator==(const CObject& other) const;
32      // bool operator!=(const CObject& other) const;
[219]33
[769]34      /// Flux ///
35      friend StdOStream& operator<<(StdOStream& os, const CObject& object);
[219]36
[769]37      /// Autres ///
38      virtual StdString toString(void) const = 0;
39      virtual void fromString(const StdString& str) = 0;
[219]40
[769]41    protected:
42      /// Constructeurs ///
43      CObject(void);
44      explicit CObject(const StdString& id, bool idAutoGenerated = false);
45      CObject(const CObject& object);
46      CObject(const CObject* const object); // Not implemented.
[219]47
[769]48    private:
49      /// Propriétés ///
50      StdString id;   // identifiant de l'Object
51      bool idDefined; // true si l'object est identifié, false sinon.
52      bool idAutoGenerated; //!< true if and only the id was automatically generated
53  }; // class CObject
[335]54} // namespace xios
[219]55
[591]56#endif // __XIOS_CObject__
Note: See TracBrowser for help on using the repository browser.