[152] | 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 | |
---|
| 13 | namespace xmlioserver |
---|
| 14 | { |
---|
| 15 | namespace tree |
---|
| 16 | { |
---|
| 17 | /// ////////////////////// Déclarations ////////////////////// /// |
---|
| 18 | template <class T> |
---|
| 19 | class CAttributeTemplate : public CAttribute |
---|
| 20 | { |
---|
| 21 | typedef CAttribute SuperClass; |
---|
| 22 | |
---|
| 23 | public : |
---|
| 24 | |
---|
| 25 | /// Typedef /// |
---|
| 26 | typedef T ValueType; |
---|
| 27 | |
---|
| 28 | /// Constructeurs /// |
---|
| 29 | explicit CAttributeTemplate(const StdString & id); |
---|
| 30 | CAttributeTemplate(const StdString & id, |
---|
| 31 | xios_map<StdString, CAttribute*> & umap); |
---|
| 32 | CAttributeTemplate(const StdString & id, const ValueType & value); |
---|
| 33 | CAttributeTemplate(const StdString & id, const ValueType & value, |
---|
| 34 | xios_map<StdString, CAttribute*> & umap); |
---|
| 35 | CAttributeTemplate(const CAttribute & attribut) throw (CException); |
---|
| 36 | CAttributeTemplate(const CAttribute * const attribut); // Not implemented. |
---|
| 37 | |
---|
[204] | 38 | public : |
---|
| 39 | |
---|
[152] | 40 | /// Accesseur /// |
---|
| 41 | inline ValueType getValue(void) const; |
---|
| 42 | |
---|
| 43 | /// Mutateurs /// |
---|
| 44 | inline void setValue(const ValueType & value); |
---|
| 45 | |
---|
| 46 | /// Destructeur /// |
---|
| 47 | virtual ~CAttributeTemplate(void); |
---|
| 48 | |
---|
| 49 | /// Operateur /// |
---|
| 50 | ValueType operator=(const ValueType & value); |
---|
| 51 | |
---|
| 52 | /// Autre /// |
---|
| 53 | virtual StdString toString(void) const; |
---|
| 54 | virtual void fromString(const StdString & str); |
---|
| 55 | |
---|
| 56 | virtual void toBinary (StdOStream & os) const; |
---|
[173] | 57 | virtual void fromBinary(StdIStream & is); |
---|
[152] | 58 | |
---|
| 59 | protected : |
---|
| 60 | |
---|
| 61 | /// Constructeurs /// |
---|
| 62 | CAttributeTemplate(void); // Not implemented. |
---|
| 63 | |
---|
[173] | 64 | }; // class CAttribute |
---|
| 65 | |
---|
[152] | 66 | } // namespace tree |
---|
[173] | 67 | |
---|
| 68 | template <class T> void FromBinary(StdIStream & is, T & obj); |
---|
| 69 | |
---|
[152] | 70 | } // namespace xmlioserver |
---|
| 71 | |
---|
| 72 | #endif // __XMLIO_CAttributeTemplate__ |
---|