source: XIOS/trunk/src/attribute_template.hpp @ 313

Last change on this file since 313 was 313, checked in by ymipsl, 12 years ago

Fortran attribut interface are now automaticaly generated.
Add get attribut fonctionnality from fortran.

YM

File size: 3.1 KB
Line 
1#ifndef __XMLIO_CAttributeTemplate__
2#define __XMLIO_CAttributeTemplate__
3
4/// boost headers ///
5#include <boost/lexical_cast.hpp>
6
7/// xmlioserver headers ///
8#include "xmlioserver_spl.hpp"
9#include "exception.hpp"
10#include "array.hpp"
11#include "attribute.hpp"
12#include "buffer_in.hpp"
13#include "buffer_out.hpp"
14
15
16namespace xmlioserver
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;
45            inline ValueType* getRef(void) ;
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
63            virtual bool toBuffer  (CBufferOut& buffer) const;
64            virtual bool fromBuffer(CBufferIn& buffer) ;
65            virtual size_t size(void) const;
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) ;
74
75     
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   
87} // namespace xmlioserver
88
89#endif // __XMLIO_CAttributeTemplate__
Note: See TracBrowser for help on using the repository browser.