Privacy
An open-source, flexible 3D physical simulation framework
configmaps::ConfigMap Class Reference

#include <ConfigMap.hpp>

Public Member Functions

 ConfigMap (const YAML::Node &n)
 Create and fill the object with values from YAML node. More...
 
 ConfigMap (const Json::Value &v)
 Create and fill the object with values from Json value. More...
 
 ConfigMap ()
 
ConfigItemoperator[] (const std::string &name)
 
ConfigItemoperator[] (const char *name)
 
bool hasKey (std::string key)
 
void updateMap (ConfigMap &update)
 
virtual void dumpToYamlEmitter (YAML::Emitter &emitter) const
 Create YAML representation of this ConfigMap to a YAML::Emmitter. More...
 
virtual void dumpToJsonValue (Json::Value &root) const
 Create Json representation of this ConfigMap to a Json::Value. More...
 
template<typename T >
get (const std::string &key, const T &defaultValue)
 
template<typename T >
getOrCreate (const std::string &key, const T &defaultValue)
 
- Public Member Functions inherited from configmaps::ConfigBase
virtual ~ConfigBase ()
 
 ConfigBase (std::string s)
 
 ConfigBase ()
 
void setParentName (std::string s)
 
const std::string & getParentName () const
 
void toYamlStream (std::ostream &out) const
 
void toYamlFile (const std::string &filename) const
 
std::string toYamlString () const
 
void toJsonStream (std::ostream &out) const
 
std::string toJsonString () const
 

Static Public Member Functions

static ConfigMap fromYamlStream (std::istream &in)
 
static ConfigMap fromYamlFile (const std::string &filename, bool loadURI=false)
 
static ConfigMap fromYamlString (const std::string &s)
 
static ConfigMap fromJsonStream (std::istream &in)
 
static ConfigMap fromJsonString (const std::string &s)
 

Additional Inherited Members

- Protected Attributes inherited from configmaps::ConfigBase
std::string parentName
 

Detailed Description

Definition at line 47 of file ConfigMap.hpp.

Constructor & Destructor Documentation

◆ ConfigMap() [1/3]

configmaps::ConfigMap::ConfigMap ( const YAML::Node &  n)

Create and fill the object with values from YAML node.

Parameters
nThe node containing the data.

Definition at line 21 of file ConfigMap.cpp.

◆ ConfigMap() [2/3]

configmaps::ConfigMap::ConfigMap ( const Json::Value &  v)

Create and fill the object with values from Json value.

Parameters
vThe value containing the data.

Definition at line 32 of file ConfigMap.cpp.

◆ ConfigMap() [3/3]

configmaps::ConfigMap::ConfigMap ( )
inline

Definition at line 61 of file ConfigMap.hpp.

Member Function Documentation

◆ dumpToJsonValue()

void configmaps::ConfigMap::dumpToJsonValue ( Json::Value &  root) const
virtual

Create Json representation of this ConfigMap to a Json::Value.

Parameters
rootThe output value. (parameter gets modified!).

Implements configmaps::ConfigBase.

Definition at line 100 of file ConfigMap.cpp.

◆ dumpToYamlEmitter()

void configmaps::ConfigMap::dumpToYamlEmitter ( YAML::Emitter &  emitter) const
virtual

Create YAML representation of this ConfigMap to a YAML::Emmitter.

Parameters
emitterThe output emitter. (parameter gets modified!).

Implements configmaps::ConfigBase.

Definition at line 83 of file ConfigMap.cpp.

◆ fromJsonStream()

ConfigMap configmaps::ConfigMap::fromJsonStream ( std::istream &  in)
static

Definition at line 69 of file ConfigMap.cpp.

◆ fromJsonString()

ConfigMap configmaps::ConfigMap::fromJsonString ( const std::string &  s)
static

Definition at line 78 of file ConfigMap.cpp.

◆ fromYamlFile()

ConfigMap configmaps::ConfigMap::fromYamlFile ( const std::string &  filename,
bool  loadURI = false 
)
static

Definition at line 54 of file ConfigMap.cpp.

◆ fromYamlStream()

ConfigMap configmaps::ConfigMap::fromYamlStream ( std::istream &  in)
static

Definition at line 45 of file ConfigMap.cpp.

◆ fromYamlString()

ConfigMap configmaps::ConfigMap::fromYamlString ( const std::string &  s)
static

Definition at line 64 of file ConfigMap.cpp.

◆ get()

template<typename T >
T configmaps::ConfigMap::get ( const std::string &  key,
const T &  defaultValue 
)
inline

Definition at line 104 of file ConfigMap.hpp.

◆ getOrCreate()

template<typename T >
T configmaps::ConfigMap::getOrCreate ( const std::string &  key,
const T &  defaultValue 
)
inline

Definition at line 113 of file ConfigMap.hpp.

◆ hasKey()

bool configmaps::ConfigMap::hasKey ( std::string  key)

Definition at line 131 of file ConfigMap.cpp.

◆ operator[]() [1/2]

ConfigItem& configmaps::ConfigMap::operator[] ( const std::string &  name)
inline

Definition at line 63 of file ConfigMap.hpp.

◆ operator[]() [2/2]

ConfigItem& configmaps::ConfigMap::operator[] ( const char *  name)
inline

Definition at line 73 of file ConfigMap.hpp.

◆ updateMap()

void configmaps::ConfigMap::updateMap ( ConfigMap update)

Definition at line 135 of file ConfigMap.cpp.


The documentation for this class was generated from the following files: