[219] | 1 | #ifndef __XMLIO_CAttributeTemplate__ |
---|
| 2 | #define __XMLIO_CAttributeTemplate__ |
---|
| 3 | |
---|
| 4 | /// boost headers /// |
---|
| 5 | #include <boost/lexical_cast.hpp> |
---|
| 6 | |
---|
[335] | 7 | /// xios headers /// |
---|
[219] | 8 | #include "xmlioserver_spl.hpp" |
---|
| 9 | #include "exception.hpp" |
---|
| 10 | #include "array.hpp" |
---|
| 11 | #include "attribute.hpp" |
---|
[300] | 12 | #include "buffer_in.hpp" |
---|
| 13 | #include "buffer_out.hpp" |
---|
[219] | 14 | |
---|
[300] | 15 | |
---|
[335] | 16 | namespace xios |
---|
[219] | 17 | { |
---|
| 18 | namespace tree |
---|
| 19 | { |
---|
| 20 | /// ////////////////////// Déclarations ////////////////////// /// |
---|
| 21 | template <class T> |
---|
| 22 | class CAttributeTemplate : public CAttribute |
---|
| 23 | { |
---|
| 24 | typedef CAttribute SuperClass; |
---|
| 25 | |
---|
| 26 | public : |
---|
| 27 | |
---|
| 28 | /// Typedef /// |
---|
| 29 | typedef T ValueType; |
---|
| 30 | |
---|
| 31 | /// Constructeurs /// |
---|
| 32 | explicit CAttributeTemplate(const StdString & id); |
---|
| 33 | CAttributeTemplate(const StdString & id, |
---|
| 34 | xios_map<StdString, CAttribute*> & umap); |
---|
| 35 | CAttributeTemplate(const StdString & id, const ValueType & value); |
---|
| 36 | CAttributeTemplate(const StdString & id, const ValueType & value, |
---|
| 37 | xios_map<StdString, CAttribute*> & umap); |
---|
| 38 | CAttributeTemplate(const CAttribute & attribut) throw (CException); |
---|
| 39 | CAttributeTemplate(const CAttribute * const attribut); // Not implemented. |
---|
| 40 | |
---|
| 41 | public : |
---|
| 42 | |
---|
| 43 | /// Accesseur /// |
---|
| 44 | inline ValueType getValue(void) const; |
---|
[300] | 45 | inline ValueType* getRef(void) ; |
---|
[219] | 46 | |
---|
| 47 | /// Mutateurs /// |
---|
| 48 | inline void setValue(const ValueType & value); |
---|
| 49 | |
---|
| 50 | /// Destructeur /// |
---|
| 51 | virtual ~CAttributeTemplate(void); |
---|
| 52 | |
---|
| 53 | /// Operateur /// |
---|
| 54 | ValueType operator=(const ValueType & value); |
---|
| 55 | |
---|
| 56 | /// Autre /// |
---|
| 57 | virtual StdString toString(void) const; |
---|
| 58 | virtual void fromString(const StdString & str); |
---|
| 59 | |
---|
| 60 | virtual void toBinary (StdOStream & os) const; |
---|
| 61 | virtual void fromBinary(StdIStream & is); |
---|
| 62 | |
---|
[300] | 63 | virtual bool toBuffer (CBufferOut& buffer) const; |
---|
| 64 | virtual bool fromBuffer(CBufferIn& buffer) ; |
---|
| 65 | virtual size_t size(void) const; |
---|
[313] | 66 | virtual void generateCInterface(ostream& oss,const string& className) ; |
---|
| 67 | virtual void generateFortran2003Interface(ostream& oss,const string& className) ; |
---|
| 68 | virtual void generateFortranInterfaceDeclaration_(ostream& oss,const string& className) ; |
---|
| 69 | virtual void generateFortranInterfaceBody_(ostream& oss,const string& className) ; |
---|
| 70 | virtual void generateFortranInterfaceDeclaration(ostream& oss,const string& className) ; |
---|
| 71 | virtual void generateFortranInterfaceGetDeclaration_(ostream& oss,const string& className) ; |
---|
| 72 | virtual void generateFortranInterfaceGetBody_(ostream& oss,const string& className) ; |
---|
| 73 | virtual void generateFortranInterfaceGetDeclaration(ostream& oss,const string& className) ; |
---|
[300] | 74 | |
---|
[313] | 75 | |
---|
[219] | 76 | protected : |
---|
| 77 | |
---|
| 78 | /// Constructeurs /// |
---|
| 79 | CAttributeTemplate(void); // Not implemented. |
---|
| 80 | |
---|
| 81 | }; // class CAttribute |
---|
| 82 | |
---|
| 83 | } // namespace tree |
---|
| 84 | |
---|
| 85 | template <class T> void FromBinary(StdIStream & is, T & obj); |
---|
| 86 | |
---|
[335] | 87 | } // namespace xios |
---|
[219] | 88 | |
---|
| 89 | #endif // __XMLIO_CAttributeTemplate__ |
---|