40 #ifndef __OPENFLUID_CORE_MAPVALUE_HPP__
41 #define __OPENFLUID_CORE_MAPVALUE_HPP__
57 namespace openfluid {
namespace core {
138 typedef std::map<std::string,std::shared_ptr<Value> >
Map_t;
177 void writeToStream(std::ostream& OutStm)
const;
180 { writeToStream(OutStm); }
187 void set(
const std::string& Key,
Value* Element);
194 inline void setDouble(
const std::string& Key,
const double& Val)
203 inline void setInteger(
const std::string& Key,
const long& Val)
211 inline void setBoolean(
const std::string& Key,
const bool& Val)
219 inline void setString(
const std::string& Key,
const std::string& Val)
250 Value& operator[](
const std::string& Key);
257 Value& at(
const std::string& Key);
264 const Value& at(
const std::string& Key)
const;
272 {
return at(Key).asDoubleValue().get(); }
280 {
return at(Key).asIntegerValue().get(); }
288 {
return at(Key).asBooleanValue().get(); }
295 inline std::string
getString(
const std::string& Key)
const
296 {
return at(Key).asStringValue().get(); }
326 bool remove(
const std::string& Key);
333 {
return m_Value.size(); }
340 {
return m_Value.size(); }
348 {
return (m_Value.find(Key) != m_Value.end()); }
354 std::vector<std::string> getKeys()
const;
366 {
return m_Value.begin(); }
373 {
return m_Value.begin(); }
380 {
return m_Value.end(); }
387 {
return m_Value.end(); }
std::map< std::string, std::shared_ptr< Value > > Map_t
Definition: MapValue.hpp:138
Map_t::const_iterator const_iterator
Definition: MapValue.hpp:142
const VectorValue & asVectorValue() const
MapValue getMapValue(const std::string &Key) const
Definition: MapValue.hpp:319
void setMatrixValue(const std::string &Key, const MatrixValue &Val)
Definition: MapValue.hpp:235
Definition: StringValue.hpp:91
Map_t::iterator iterator
Definition: MapValue.hpp:140
const MapValue & asMapValue() const
MapValue(const Map_t &Val)
Definition: MapValue.hpp:163
void writeQuotedToStream(std::ostream &OutStm) const
Definition: MapValue.hpp:179
Definition: MatrixValue.hpp:114
Definition: DoubleValue.hpp:102
Definition: CompoundValue.hpp:50
iterator begin()
Definition: MapValue.hpp:365
void setBoolean(const std::string &Key, const bool &Val)
Definition: MapValue.hpp:211
MatrixValue getMatrixValue(const std::string &Key) const
Definition: MapValue.hpp:311
const MatrixValue & asMatrixValue() const
unsigned long size() const
Definition: MapValue.hpp:339
#define OPENFLUID_API
Definition: dllexport.hpp:87
void setDouble(const std::string &Key, const double &Val)
Definition: MapValue.hpp:194
void setInteger(const std::string &Key, const long &Val)
Definition: MapValue.hpp:203
Type getType() const
Definition: MapValue.hpp:171
const_iterator end() const
Definition: MapValue.hpp:386
MapValue()
Definition: MapValue.hpp:155
bool isKeyExist(const std::string &Key) const
Definition: MapValue.hpp:347
void setVectorValue(const std::string &Key, const VectorValue &Val)
Definition: MapValue.hpp:227
double getDouble(const std::string &Key) const
Definition: MapValue.hpp:271
Definition: BooleanValue.hpp:103
long getInteger(const std::string &Key) const
Definition: MapValue.hpp:279
std::string getString(const std::string &Key) const
Definition: MapValue.hpp:295
unsigned long getSize() const
Definition: MapValue.hpp:332
VectorValue getVectorValue(const std::string &Key) const
Definition: MapValue.hpp:303
iterator end()
Definition: MapValue.hpp:379
void setString(const std::string &Key, const std::string &Val)
Definition: MapValue.hpp:219
Definition: MapValue.hpp:134
void setMapValue(const std::string &Key, const MapValue &Val)
Definition: MapValue.hpp:243
Type
Definition: Value.hpp:68
Definition: IntegerValue.hpp:105
bool getBoolean(const std::string &Key) const
Definition: MapValue.hpp:287
Value * clone() const
Definition: MapValue.hpp:174
Definition: VectorValue.hpp:118
const_iterator begin() const
Definition: MapValue.hpp:372