All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Attributes.hpp
Go to the documentation of this file.
1 /*
2 
3  This file is part of OpenFLUID software
4  Copyright(c) 2007, INRA - Montpellier SupAgro
5 
6 
7  == GNU General Public License Usage ==
8 
9  OpenFLUID is free software: you can redistribute it and/or modify
10  it under the terms of the GNU General Public License as published by
11  the Free Software Foundation, either version 3 of the License, or
12  (at your option) any later version.
13 
14  OpenFLUID is distributed in the hope that it will be useful,
15  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  GNU General Public License for more details.
18 
19  You should have received a copy of the GNU General Public License
20  along with OpenFLUID. If not, see <http://www.gnu.org/licenses/>.
21 
22 
23  == Other Usage ==
24 
25  Other Usage means a use of OpenFLUID that is inconsistent with the GPL
26  license, and requires a written agreement between You and INRA.
27  Licensees for Other Usage of OpenFLUID may use this file in accordance
28  with the terms contained in the written agreement between You and INRA.
29 
30 */
31 
32 #ifndef __ATTRIBUTES_H__
33 #define __ATTRIBUTES_H__
34 
36 #include <openfluid/dllexport.hpp>
37 #include <openfluid/core/Value.hpp>
40 
41 
42 namespace openfluid {
43 namespace core {
44 
46 {
47  private:
48 
49  typedef std::map<AttributeName_t, StringValue> AttributesMap_t;
50  AttributesMap_t m_Data;
51 
52  public:
53 
54  Attributes();
55 
56  ~Attributes();
57 
58  bool setValue(const AttributeName_t aName, const Value& aValue);
59 
60  bool setValue(const AttributeName_t aName, const std::string& aValue);
61 
62  bool getValue(const AttributeName_t aName, openfluid::core::StringValue& aValue) const;
63 
64  bool getValue(const AttributeName_t aName, std::string& aValue) const;
65 
66  bool getValueAsDouble(const AttributeName_t aName, double& aValue) const;
67 
68  bool getValueAsLong(const AttributeName_t aName, long& aValue) const;
69 
70  bool isAttributeExist(const AttributeName_t aName) const;
71 
72  std::vector<AttributeName_t> getAttributesNames() const;
73 
74  bool replaceValue(const AttributeName_t aName, const StringValue& aValue);
75 
76  bool replaceValue(const AttributeName_t aName, const std::string& aValue);
77 
78  bool removeAttribute(const AttributeName_t aName);
79 
80  void clear();
81 
82 };
83 
84 
85 } } // namespaces
86 
87 
88 #endif /* __ATTRIBUTES_H__ */
std::string AttributeName_t
Definition: TypeDefs.hpp:74
Definition: StringValue.hpp:91
Header of ...
Header of ...
Definition: Attributes.hpp:45
Definition: Value.hpp:64
Header of ...
#define DLLEXPORT
Definition: dllexport.hpp:51