1 | /* ************************************************************************** * |
---|
2 | * Copyright © IPSL/LSCE, XMLIOServer, Avril 2010 - Octobre 2011 * |
---|
3 | * ************************************************************************** */ |
---|
4 | |
---|
5 | #ifndef __ATTRIBUTE_MAP_HPP__ |
---|
6 | #define __ATTRIBUTE_MAP_HPP__ |
---|
7 | |
---|
8 | /** |
---|
9 | * \file attribute_map.hpp |
---|
10 | * \brief Gestion des map d'attributs d'objets (entête). |
---|
11 | * \author Hervé Ozdoba |
---|
12 | * \version 0.4 |
---|
13 | * \date 1er Juin 2011 |
---|
14 | */ |
---|
15 | |
---|
16 | // XMLIOServer headers |
---|
17 | #include "xmlioserver_spl.hpp" |
---|
18 | #include "attribute.hpp" |
---|
19 | #include "attribute_template.hpp" |
---|
20 | |
---|
21 | // ////////////////////////////// Déclarations ///////////////////////////// // |
---|
22 | |
---|
23 | namespace xmlioserver { |
---|
24 | namespace tree { |
---|
25 | |
---|
26 | class CAttributeMap |
---|
27 | : public xios_map<std::string, CAttribute*> |
---|
28 | { |
---|
29 | typedef xios_map<std::string, CAttribute*> SuperClassMap; |
---|
30 | |
---|
31 | public : // Test |
---|
32 | |
---|
33 | inline bool hasAttribute(const std::string & _key) const; |
---|
34 | |
---|
35 | public : // Accesseur |
---|
36 | |
---|
37 | CAttribute * operator[](const std::string & _key) throw (CException); |
---|
38 | |
---|
39 | public : // Mutateur |
---|
40 | |
---|
41 | void setAttribute(const std::string & key, CAttribute * const _attribute) throw (CException); |
---|
42 | |
---|
43 | void setAttributes(const std::map <std::string, std::string> & _attributes); |
---|
44 | void setAttributes(const CAttributeMap * const _parent); |
---|
45 | |
---|
46 | void clearAllAttributes(void); |
---|
47 | |
---|
48 | public : // Destructeur |
---|
49 | |
---|
50 | virtual ~CAttributeMap(void); |
---|
51 | |
---|
52 | public : // Flux |
---|
53 | |
---|
54 | // Debug only // |
---|
55 | // friend StdOStream & operator << (StdOStream & os, const CAttributeMap & attributmap); |
---|
56 | |
---|
57 | public : // Autres |
---|
58 | |
---|
59 | virtual std::string toString(void) const; |
---|
60 | virtual void fromString(const std::string & _str) throw (CException); |
---|
61 | |
---|
62 | virtual void toBinary (std::ostream & _os) const; |
---|
63 | virtual void fromBinary(std::istream & _is) throw (CException); |
---|
64 | |
---|
65 | protected : // Constructeurs |
---|
66 | |
---|
67 | CAttributeMap(void); |
---|
68 | CAttributeMap(const xios_map<std::string, CAttribute*> & _umap); // Never implemented. |
---|
69 | CAttributeMap(const xios_map<std::string, CAttribute*> * const _umap); // Not implemented. |
---|
70 | |
---|
71 | protected : // Propriété statique |
---|
72 | |
---|
73 | static CAttributeMap * Current; |
---|
74 | |
---|
75 | }; // class CAttributeMap |
---|
76 | } // namespace tree |
---|
77 | } // namespace xmlioserver |
---|
78 | |
---|
79 | #endif // __ATTRIBUTE_MAP_HPP__ |
---|