[591] | 1 | #ifndef __XIOS_CAttribute__ |
---|
| 2 | #define __XIOS_CAttribute__ |
---|
[219] | 3 | |
---|
| 4 | /// boost headers /// |
---|
| 5 | |
---|
[591] | 6 | /// XIOS headers /// |
---|
| 7 | #include "xios_spl.hpp" |
---|
[219] | 8 | #include "object.hpp" |
---|
[300] | 9 | #include "base_type.hpp" |
---|
| 10 | #include "message.hpp" |
---|
| 11 | #include "buffer_in.hpp" |
---|
| 12 | #include "buffer_out.hpp" |
---|
[219] | 13 | |
---|
[335] | 14 | namespace xios |
---|
[219] | 15 | { |
---|
| 16 | /// ////////////////////// Déclarations ////////////////////// /// |
---|
[1158] | 17 | /*! |
---|
| 18 | \class CAttribute |
---|
| 19 | The fundamental class which describes the attributes of other different class in XIOS. |
---|
| 20 | This class only plays a role of interface, its class child will have specific implelemtation corresponding to type of attribute |
---|
| 21 | */ |
---|
[369] | 22 | class CAttribute : public CObject, public virtual CBaseType |
---|
[219] | 23 | { |
---|
| 24 | typedef CObject SuperClass; |
---|
| 25 | |
---|
| 26 | public : |
---|
| 27 | |
---|
| 28 | /// Constructeurs /// |
---|
| 29 | explicit CAttribute(const StdString & id); |
---|
| 30 | |
---|
| 31 | /// Accesseurs /// |
---|
| 32 | const StdString & getName(void) const; |
---|
| 33 | |
---|
[369] | 34 | virtual void set(const CAttribute& ) =0 ; |
---|
[460] | 35 | virtual void reset(void ) =0 ; |
---|
[219] | 36 | /// Destructeur /// |
---|
| 37 | virtual ~CAttribute(void); |
---|
| 38 | |
---|
| 39 | /// Autres /// |
---|
| 40 | virtual StdString toString(void) const = 0; |
---|
| 41 | virtual void fromString(const StdString & str) = 0; |
---|
[1622] | 42 | virtual StdString dump(void) const = 0; |
---|
[2146] | 43 | virtual StdString dumpGraph(void) const = 0; |
---|
[1158] | 44 | virtual bool isEqual(const CAttribute& ) = 0; |
---|
[2388] | 45 | virtual size_t computeHash(void) = 0; |
---|
[219] | 46 | |
---|
[778] | 47 | //! Returns true if and only if the attribute should be publicly exposed in the API |
---|
| 48 | virtual bool isPublic() const { return true; } |
---|
[1025] | 49 | |
---|
| 50 | //! Return true if the attribute should be sent to other clients or servers |
---|
| 51 | virtual bool doSend() const { return true; } |
---|
[778] | 52 | |
---|
[1158] | 53 | /* |
---|
| 54 | Groupd of functions to generate C and Fortran interface |
---|
| 55 | */ |
---|
[313] | 56 | virtual void generateCInterface(ostream& oss, const string& className) = 0 ; |
---|
[432] | 57 | virtual void generateCInterfaceIsDefined(ostream& oss, const string& className) ; |
---|
[313] | 58 | virtual void generateFortran2003Interface(ostream& oss, const string& className) = 0 ; |
---|
[432] | 59 | virtual void generateFortran2003InterfaceIsDefined(ostream& oss, const string& className) ; |
---|
[313] | 60 | virtual void generateFortranInterfaceDeclaration_(ostream& oss,const string& className) = 0 ; |
---|
| 61 | virtual void generateFortranInterfaceDeclaration(ostream& oss,const string& className) = 0 ; |
---|
| 62 | virtual void generateFortranInterfaceBody_(ostream& oss,const string& className) = 0 ; |
---|
| 63 | virtual void generateFortranInterfaceGetDeclaration_(ostream& oss,const string& className) = 0 ; |
---|
| 64 | virtual void generateFortranInterfaceGetDeclaration(ostream& oss,const string& className) = 0 ; |
---|
| 65 | virtual void generateFortranInterfaceGetBody_(ostream& oss,const string& className) = 0 ; |
---|
[432] | 66 | virtual void generateFortranInterfaceIsDefinedDeclaration_(ostream& oss,const string& className) ; |
---|
| 67 | virtual void generateFortranInterfaceIsDefinedDeclaration(ostream& oss,const string& className) ; |
---|
| 68 | virtual void generateFortranInterfaceIsDefinedBody_(ostream& oss,const string& className) ; |
---|
[219] | 69 | |
---|
[445] | 70 | virtual void setInheritedValue(const CAttribute& ) = 0 ; |
---|
| 71 | virtual bool hasInheritedValue(void) const = 0; |
---|
[219] | 72 | |
---|
[1158] | 73 | bool canInherite(void) {return _canInherite ;} |
---|
[2634] | 74 | void setCannotInherit(void) {_canInherite=false ;} |
---|
| 75 | void setCanInherit(void) {_canInherite=true ;} |
---|
[1158] | 76 | protected : |
---|
| 77 | bool _canInherite ; |
---|
| 78 | static const StdString resetInheritanceStr ; |
---|
[219] | 79 | |
---|
| 80 | }; // class CAttribute |
---|
| 81 | |
---|
[345] | 82 | CMessage& operator<<(CMessage& msg,CAttribute& type) ; |
---|
| 83 | CMessage& operator<<(CMessage& msg, const CAttribute& type) ; |
---|
[300] | 84 | |
---|
[345] | 85 | CBufferOut& operator<<(CBufferOut& buffer,CAttribute& type) ; |
---|
| 86 | CBufferIn& operator>>(CBufferIn& buffer, CAttribute& type) ; |
---|
[369] | 87 | |
---|
[300] | 88 | } |
---|
[335] | 89 | // namespace xios |
---|
[219] | 90 | |
---|
[591] | 91 | #endif // __XIOS_CAttribute__ |
---|