#include <core/MapValue.hpp>
|
typedef std::map< std::string, std::shared_ptr< Value > > | Map_t |
|
typedef Map_t::iterator | iterator |
|
typedef Map_t::const_iterator | const_iterator |
|
enum | Type {
NONE,
BOOLEAN,
INTEGER,
DOUBLE,
STRING,
VECTOR,
MATRIX,
MAP,
TREE,
NULLL
} |
|
MapValue is a container for a key => value map, where keys are strings and values can be any type derived from openfluid::core::Value.
- See also
- Value
Example : declaration
Example : setting the contained values
Example : getting the contained values
double DblTmp1;
Tmp1 = Val1.getDoubleValue("myvalue1");
Example : testing the contained elements
Example : conversion from string
StringVal.
set(
"{\"myvalue1\":toto,\"myvalue2\"=12.56,\"myvalue3\"=17,\"myvalue3\"=false");
Example : conversion to string
std::string StdStrVal = Val1.
toString();
openfluid::core::MapValue::MapValue |
( |
| ) |
|
|
inline |
openfluid::core::MapValue::MapValue |
( |
const MapValue & |
Val | ) |
|
openfluid::core::MapValue::MapValue |
( |
const Map_t & |
Val | ) |
|
|
inline |
openfluid::core::MapValue::~MapValue |
( |
| ) |
|
Value& openfluid::core::MapValue::at |
( |
const std::string & |
Key | ) |
|
Returns a reference to the value of the map at the given key
- Parameters
-
[in] | Key | the key of the requested value |
- Returns
- the value at the given key
const Value& openfluid::core::MapValue::at |
( |
const std::string & |
Key | ) |
const |
Returns a const reference to the value of the map at the given key
- Parameters
-
[in] | Key | the key of the requested value |
- Returns
- the value at the given key
iterator openfluid::core::MapValue::begin |
( |
| ) |
|
|
inline |
Returns an iterator referring to the first element in the map
- Returns
- an iterator to the first element in the map
Returns a constant iterator referring to the first element in the map
- Returns
- a constant iterator to the first element in the map
void openfluid::core::MapValue::clear |
( |
| ) |
|
Clears the map by removing all values
Value* openfluid::core::MapValue::clone |
( |
| ) |
const |
|
inlinevirtual |
iterator openfluid::core::MapValue::end |
( |
| ) |
|
|
inline |
Returns an iterator referring to the past-the-end element in the map
- Returns
- an iterator to the past-the-end element in the map
Returns a constant iterator referring to the past-the-end element in the map
- Returns
- a constant iterator to the past-the-end element in the map
bool openfluid::core::MapValue::getBoolean |
( |
const std::string & |
Key | ) |
const |
|
inline |
Returns the boolean value of the map at the given key
- Parameters
-
[in] | Key | the key of the requested value |
- Returns
- the value at the given key
double openfluid::core::MapValue::getDouble |
( |
const std::string & |
Key | ) |
const |
|
inline |
Returns the double value of the map at the given key
- Parameters
-
[in] | Key | the key of the requested value |
- Returns
- the value at the given key
long openfluid::core::MapValue::getInteger |
( |
const std::string & |
Key | ) |
const |
|
inline |
Returns the long value of the map at the given key
- Parameters
-
[in] | Key | the key of the requested value |
- Returns
- the value at the given key
std::vector<std::string> openfluid::core::MapValue::getKeys |
( |
| ) |
const |
Returns the list of keys of the map
- Returns
- a std::vector of std::string containing the keys of the map
MapValue openfluid::core::MapValue::getMapValue |
( |
const std::string & |
Key | ) |
const |
|
inline |
Returns the MapValue value of the map at the given key
- Parameters
-
[in] | Key | the key of the requested value |
- Returns
- the value at the given key
MatrixValue openfluid::core::MapValue::getMatrixValue |
( |
const std::string & |
Key | ) |
const |
|
inline |
Returns the MatrixValue value of the map at the given key
- Parameters
-
[in] | Key | the key of the requested value |
- Returns
- the value at the given key
unsigned long openfluid::core::MapValue::getSize |
( |
| ) |
const |
|
inline |
Returns the size of the map
- Returns
- size of the map
std::string openfluid::core::MapValue::getString |
( |
const std::string & |
Key | ) |
const |
|
inline |
Returns the string value of the map at the given key
- Parameters
-
[in] | Key | the key of the requested value |
- Returns
- the value at the given key
Type openfluid::core::MapValue::getType |
( |
| ) |
const |
|
inlinevirtual |
VectorValue openfluid::core::MapValue::getVectorValue |
( |
const std::string & |
Key | ) |
const |
|
inline |
Returns the VectorValue value of the map at the given key
- Parameters
-
[in] | Key | the key of the requested value |
- Returns
- the value at the given key
bool openfluid::core::MapValue::isKeyExist |
( |
const std::string & |
Key | ) |
const |
|
inline |
Checks if the given key exists
- Parameters
-
- Returns
- true if the given key is present
Value& openfluid::core::MapValue::operator= |
( |
const Value & |
| ) |
|
|
virtual |
Value& openfluid::core::MapValue::operator[] |
( |
const std::string & |
Key | ) |
|
Operator to get/set a value at a key given between []
- Returns
- the value at the given key
bool openfluid::core::MapValue::remove |
( |
const std::string & |
Key | ) |
|
Removes the value corresponding to the given key
- Parameters
-
void openfluid::core::MapValue::set |
( |
const std::string & |
Key, |
|
|
Value * |
Element |
|
) |
| |
Sets a new value at the given key
- Parameters
-
void openfluid::core::MapValue::setBoolean |
( |
const std::string & |
Key, |
|
|
const bool & |
Val |
|
) |
| |
|
inline |
Sets a new boolean value at the given key
- Parameters
-
[in] | Key | the key to add |
[in] | Val | the value to add |
void openfluid::core::MapValue::setDouble |
( |
const std::string & |
Key, |
|
|
const double & |
Val |
|
) |
| |
|
inline |
Sets a new double value at the given key
- Parameters
-
[in] | Key | the key to add |
[in] | Val | the value to add |
void openfluid::core::MapValue::setInteger |
( |
const std::string & |
Key, |
|
|
const long & |
Val |
|
) |
| |
|
inline |
Sets a new long value at the given key
- Parameters
-
[in] | Key | the key to add |
[in] | Val | the value to add |
void openfluid::core::MapValue::setMapValue |
( |
const std::string & |
Key, |
|
|
const MapValue & |
Val |
|
) |
| |
|
inline |
Sets a new MapValue value at the given key
- Parameters
-
[in] | Key | the key to add |
[in] | Val | the value to add |
void openfluid::core::MapValue::setMatrixValue |
( |
const std::string & |
Key, |
|
|
const MatrixValue & |
Val |
|
) |
| |
|
inline |
Sets a new MatrixValue value at the given key
- Parameters
-
[in] | Key | the key to add |
[in] | Val | the value to add |
void openfluid::core::MapValue::setString |
( |
const std::string & |
Key, |
|
|
const std::string & |
Val |
|
) |
| |
|
inline |
Sets a new string value at the given key
- Parameters
-
[in] | Key | the key to add |
[in] | Val | the value to add |
void openfluid::core::MapValue::setVectorValue |
( |
const std::string & |
Key, |
|
|
const VectorValue & |
Val |
|
) |
| |
|
inline |
Sets a new VectorValue value at the given key
- Parameters
-
[in] | Key | the key to add |
[in] | Val | the value to add |
unsigned long openfluid::core::MapValue::size |
( |
| ) |
const |
|
inline |
Returns the size of the map
- Returns
- size of the map
void openfluid::core::MapValue::writeQuotedToStream |
( |
std::ostream & |
OutStm | ) |
const |
|
inlinevirtual |
void openfluid::core::MapValue::writeToStream |
( |
std::ostream & |
OutStm | ) |
const |
|
virtual |
The documentation for this class was generated from the following file: