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 | |
---|
16 | namespace 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 | |
---|
67 | |
---|
68 | protected : |
---|
69 | |
---|
70 | /// Constructeurs /// |
---|
71 | CAttributeTemplate(void); // Not implemented. |
---|
72 | |
---|
73 | }; // class CAttribute |
---|
74 | |
---|
75 | } // namespace tree |
---|
76 | |
---|
77 | template <class T> void FromBinary(StdIStream & is, T & obj); |
---|
78 | |
---|
79 | } // namespace xmlioserver |
---|
80 | |
---|
81 | #endif // __XMLIO_CAttributeTemplate__ |
---|