Ignore:
Timestamp:
10/30/15 16:33:48 (9 years ago)
Author:
rlacroix
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/trunk/src/object.hpp

    r591 r769  
    77namespace xios 
    88{ 
    9    /// ////////////////////// Déclarations ////////////////////// /// 
     9  /// ////////////////////// Déclarations ////////////////////// /// 
    1010 
    11    class CObject 
    12    { 
    13       public : 
     11  class CObject 
     12  { 
     13    public: 
     14      /// Destructeur /// 
     15      virtual ~CObject(void); 
    1416 
    15          /// Destructeur /// 
    16          virtual ~CObject(void); 
     17      /// Accesseurs /// 
     18      const StdString& getId(void) const; 
    1719 
    18          /// Accesseurs /// 
    19          const StdString & getId(void) const; 
     20      virtual const StdString& getIdServer() const; 
    2021 
    21          virtual const StdString& getIdServer(); 
     22      /// Mutateurs /// 
     23      void resetId(void); 
     24      void setId(const StdString& id, bool idAutoGenerated = false); 
    2225 
    23          /// Mutateurs /// 
    24          void resetId(void); 
    25          void setId(const StdString & id); 
     26      /// Tests /// 
     27      bool hasId(void) const; 
     28      bool hasAutoGeneratedId(void) const; 
    2629 
    27          /// Tests /// 
    28          bool hasId(void) const; 
     30      /// Opérateurs /// 
     31      // bool operator==(const CObject& other) const; 
     32      // bool operator!=(const CObject& other) const; 
    2933 
    30          /// Opérateurs /// 
    31 //         bool operator==(const CObject & other) const; 
    32 //         bool operator!=(const CObject & other) const; 
     34      /// Flux /// 
     35      friend StdOStream& operator<<(StdOStream& os, const CObject& object); 
    3336 
    34          /// Flux /// 
    35          friend StdOStream & operator << (StdOStream & os, const CObject & object); 
     37      /// Autres /// 
     38      virtual StdString toString(void) const = 0; 
     39      virtual void fromString(const StdString& str) = 0; 
    3640 
    37          /// Autres /// 
    38          virtual StdString toString(void) const = 0; 
    39          virtual void fromString(const StdString & str) = 0; 
     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. 
    4047 
    41       protected : 
    42  
    43          /// Constructeurs /// 
    44          CObject(void); 
    45          explicit CObject(const StdString & id); 
    46          CObject(const CObject & object); 
    47          CObject(const CObject * const object); // Not implemented. 
    48  
    49       private : 
    50  
    51          /// Propriétés /// 
    52          StdString id ;    // identifiant de l'Object 
    53          bool IdDefined ;  // true si l'object est identifié, false sinon. 
    54  
    55    }; // class CObject 
    56  
     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 
    5754} // namespace xios 
    5855 
    5956#endif // __XIOS_CObject__ 
    60  
Note: See TracChangeset for help on using the changeset viewer.