Changeset 1158 for XIOS/dev/dev_olga/src/attribute.hpp
- Timestamp:
- 06/06/17 17:58:16 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/dev_olga/src/attribute.hpp
r1025 r1158 16 16 { 17 17 /// ////////////////////// Déclarations ////////////////////// /// 18 /*! 19 \class CAttribute 20 The fundamental class which describes the attributes of other different class in XIOS. 21 This class only plays a role of interface, its class child will have specific implelemtation corresponding to type of attribute 22 */ 18 23 class CAttribute : public CObject, public virtual CBaseType 19 24 { … … 24 29 /// Constructeurs /// 25 30 explicit CAttribute(const StdString & id); 26 // CAttribute(const CAttribute & attribut);27 // CAttribute(const CAttribute * const attribut); // Not implemented.28 31 29 32 /// Accesseurs /// 30 33 const StdString & getName(void) const; 31 // const boost::any & getAnyValue(void) const;32 // template <typename T> inline T getValue(void) const;33 // template <typename T> inline T* getRef(void);34 34 35 // /// Mutateurs ///36 // template <typename T> inline void setValue(const T & value);37 // void setAnyValue(const boost::any & value);38 // void clear(void);39 40 /// Test ///41 // bool isEmpty(void) const;42 // template <typename T> inline bool isType(void) const;43 35 virtual void set(const CAttribute& ) =0 ; 44 36 virtual void reset(void ) =0 ; … … 49 41 virtual StdString toString(void) const = 0; 50 42 virtual void fromString(const StdString & str) = 0; 51 52 // virtual void toBinary (StdOStream & os) const = 0; 53 // virtual void fromBinary(StdIStream & is) = 0; 43 virtual bool isEqual(const CAttribute& ) = 0; 54 44 55 45 //! Returns true if and only if the attribute should be publicly exposed in the API … … 59 49 virtual bool doSend() const { return true; } 60 50 51 /* 52 Groupd of functions to generate C and Fortran interface 53 */ 61 54 virtual void generateCInterface(ostream& oss, const string& className) = 0 ; 62 55 virtual void generateCInterfaceIsDefined(ostream& oss, const string& className) ; … … 75 68 virtual void setInheritedValue(const CAttribute& ) = 0 ; 76 69 virtual bool hasInheritedValue(void) const = 0; 77 78 protected :79 70 80 /// Constructeurs /// 81 // CAttribute(void); // Not implemented. 82 83 /// Propriété /// 84 // boost::any value; 71 bool canInherite(void) {return _canInherite ;} 72 protected : 73 bool _canInherite ; 74 static const StdString resetInheritanceStr ; 85 75 86 76 }; // class CAttribute 87 77 88 /// ////////////////////// Définitions ////////////////////// ///89 /*90 template <typename T>91 T CAttribute::getValue(void) const92 {93 return (boost::any_cast<T>(this->value));94 }95 96 template <typename T>97 T* CAttribute::getRef(void)98 {99 return (boost::any_cast<T>(&value));100 }101 102 template <typename T>103 void CAttribute::setValue(const T & value)104 {105 this->value = value;106 }107 108 template<typename T>109 bool CAttribute::isType(void) const110 {111 return (this->value.type() == typeid(T));112 }113 */114 115 78 CMessage& operator<<(CMessage& msg,CAttribute& type) ; 116 79 CMessage& operator<<(CMessage& msg, const CAttribute& type) ;
Note: See TracChangeset
for help on using the changeset viewer.