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

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

removed "tree" namespace

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/// xios 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 xios
17{
18      /// ////////////////////// Déclarations ////////////////////// ///
19      template <class T>
20         class CAttributeTemplate : public CAttribute
21      {
22            typedef CAttribute SuperClass;
23
24         public :
25
26            /// Typedef ///
27            typedef T ValueType;
28
29            /// Constructeurs ///
30            explicit CAttributeTemplate(const StdString & id);
31            CAttributeTemplate(const StdString & id,
32                               xios_map<StdString, CAttribute*> & umap);
33            CAttributeTemplate(const StdString & id, const ValueType & value);
34            CAttributeTemplate(const StdString & id, const ValueType & value,
35                               xios_map<StdString, CAttribute*> & umap);
36            CAttributeTemplate(const CAttribute & attribut) throw (CException);
37            CAttributeTemplate(const CAttribute * const attribut); // Not implemented.
38
39          public :
40
41            /// Accesseur ///
42            inline ValueType getValue(void) const;
43            inline ValueType* getRef(void) ;
44
45            /// Mutateurs ///
46            inline void setValue(const ValueType & value);
47
48            /// Destructeur ///
49            virtual ~CAttributeTemplate(void);
50
51            /// Operateur ///
52            ValueType operator=(const ValueType & value);
53
54            /// Autre ///
55            virtual StdString toString(void) const;
56            virtual void fromString(const StdString & str);
57
58            virtual void toBinary  (StdOStream & os) const;
59            virtual void fromBinary(StdIStream & is);           
60
61            virtual bool toBuffer  (CBufferOut& buffer) const;
62            virtual bool fromBuffer(CBufferIn& buffer) ;
63            virtual size_t size(void) const;
64            virtual void generateCInterface(ostream& oss,const string& className) ;
65            virtual void generateFortran2003Interface(ostream& oss,const string& className) ;
66            virtual void generateFortranInterfaceDeclaration_(ostream& oss,const string& className) ;
67            virtual void generateFortranInterfaceBody_(ostream& oss,const string& className) ;
68            virtual void generateFortranInterfaceDeclaration(ostream& oss,const string& className) ;
69            virtual void generateFortranInterfaceGetDeclaration_(ostream& oss,const string& className) ;
70            virtual void generateFortranInterfaceGetBody_(ostream& oss,const string& className) ;
71            virtual void generateFortranInterfaceGetDeclaration(ostream& oss,const string& className) ;
72
73     
74         protected :
75
76            /// Constructeurs ///
77            CAttributeTemplate(void); // Not implemented.
78
79      }; // class CAttribute   
80     
81   
82   template <class T>  void FromBinary(StdIStream & is, T & obj);
83   
84} // namespace xios
85
86#endif // __XMLIO_CAttributeTemplate__
Note: See TracBrowser for help on using the repository browser.