1 | #ifndef __XMLIO_CAttributeMap__ |
---|
2 | #define __XMLIO_CAttributeMap__ |
---|
3 | |
---|
4 | /// boost headers /// |
---|
5 | #include <boost/unordered_map.hpp> |
---|
6 | #include <boost/foreach.hpp> |
---|
7 | |
---|
8 | /// xmlioserver headers /// |
---|
9 | #include "xmlioserver_spl.hpp" |
---|
10 | #include "attribute.hpp" |
---|
11 | #include "attribute_template.hpp" |
---|
12 | #include "exception.hpp" |
---|
13 | #include "xml_node.hpp" |
---|
14 | |
---|
15 | namespace xmlioserver |
---|
16 | { |
---|
17 | namespace tree |
---|
18 | { |
---|
19 | /// ////////////////////// Déclarations ////////////////////// /// |
---|
20 | class CAttributeMap |
---|
21 | : public boost::unordered_map<StdString, CAttribute*> |
---|
22 | { |
---|
23 | typedef boost::unordered_map<StdString, CAttribute*> SuperClassMap; |
---|
24 | |
---|
25 | public : |
---|
26 | |
---|
27 | /// Tests /// |
---|
28 | inline bool hasAttribute(const StdString & key) const; |
---|
29 | |
---|
30 | /// Accesseurs /// |
---|
31 | inline CAttribute * operator[](const StdString & key); |
---|
32 | |
---|
33 | /// Mutateurs /// |
---|
34 | void setAttribute(const StdString & key, CAttribute * const attr); |
---|
35 | |
---|
36 | void setAttributes(const xml::THashAttributes & attributes); |
---|
37 | void setAttributes(const CAttributeMap * const _parent); |
---|
38 | |
---|
39 | /// Destructeur /// |
---|
40 | virtual ~CAttributeMap(void); |
---|
41 | |
---|
42 | /// Flux /// |
---|
43 | // Debug only // |
---|
44 | // friend StdOStream & operator << (StdOStream & os, const CAttributeMap & attributmap); |
---|
45 | |
---|
46 | /// Autre /// |
---|
47 | virtual StdString toString(void) const; |
---|
48 | virtual void fromString(const StdString & str); |
---|
49 | |
---|
50 | protected : |
---|
51 | |
---|
52 | /// Constructeurs /// |
---|
53 | CAttributeMap(void); |
---|
54 | CAttributeMap(const boost::unordered_map<StdString, CAttribute*> & umap); // Never implemented. |
---|
55 | CAttributeMap(const boost::unordered_map<StdString, CAttribute*> * const umap); // Not implemented. |
---|
56 | |
---|
57 | /// Propriété statique /// |
---|
58 | static CAttributeMap * Current; |
---|
59 | |
---|
60 | }; // class CAttributeMap |
---|
61 | |
---|
62 | } // namespace tree |
---|
63 | } // namespace xmlioserver |
---|
64 | |
---|
65 | #endif // __XMLIO_CAttributeMap__ |
---|