#include <PropertySourceDict.h>
|
| PropertySourceDict (pybind11::dict dict) |
|
virtual | ~PropertySourceDict () |
|
virtual bool | exists () |
|
virtual bool | getProperty (std::string &out, const char *property) |
|
virtual bool | getProperty (std::vector< std::string > &out, const char *property) |
|
virtual bool | getProperty (double &out, const char *property) |
|
virtual bool | getProperty (int &out, const char *property) |
|
virtual bool | getProperty (MatNd *&out, const char *property) |
|
virtual bool | getPropertyBool (const char *property, bool def=false) |
|
virtual PropertySink * | getChild (const char *prefix) |
|
virtual const std::vector< PropertySource * > & | getChildList (const char *prefix) |
|
virtual void | setProperty (const char *property, const std::string &value) |
|
virtual void | setProperty (const char *property, bool value) |
|
virtual void | setProperty (const char *property, int value) |
|
virtual void | setProperty (const char *property, double value) |
|
virtual void | setProperty (const char *property, MatNd *value) |
|
virtual PropertySink * | clone () const |
|
virtual void | saveXML (const char *fileName, const char *rootNodeName) |
|
| PropertySink () |
|
virtual | ~PropertySink () |
|
| PropertySource () |
|
virtual | ~PropertySource () |
|
PropertySource/Sink backed by a C++ dict.
Definition at line 47 of file PropertySourceDict.h.
◆ PropertySourceDict() [1/2]
Rcs::PropertySourceDict::PropertySourceDict |
( |
pybind11::dict |
dict, |
|
|
PropertySourceDict * |
parent, |
|
|
const char * |
prefix, |
|
|
bool |
exists |
|
) |
| |
|
private |
◆ PropertySourceDict() [2/2]
Rcs::PropertySourceDict::PropertySourceDict |
( |
pybind11::dict |
dict | ) |
|
◆ ~PropertySourceDict()
Rcs::PropertySourceDict::~PropertySourceDict |
( |
| ) |
|
|
virtual |
◆ appendPrefix()
void Rcs::PropertySourceDict::appendPrefix |
( |
std::ostream & |
os | ) |
|
|
protected |
◆ clone()
◆ exists()
bool Rcs::PropertySourceDict::exists |
( |
| ) |
|
|
virtual |
◆ getChild()
PropertySink * Rcs::PropertySourceDict::getChild |
( |
const char * |
prefix | ) |
|
|
virtual |
◆ getChildList()
const std::vector< PropertySource * > & Rcs::PropertySourceDict::getChildList |
( |
const char * |
prefix | ) |
|
|
virtual |
Obtain a list of child property sources. The exact meaning of this depends on the implementation. For an Xml document, it could be child elements with the same tag name. For a python dict, it could be a list of dicts.
The returned objects are owned by the parent.
Implements Rcs::PropertySource.
Definition at line 276 of file PropertySourceDict.cpp.
◆ getProperty() [1/5]
bool Rcs::PropertySourceDict::getProperty |
( |
std::string & |
out, |
|
|
const char * |
property |
|
) |
| |
|
virtual |
Read a string value.
- Parameters
-
[out] | out | storage for read value |
[in] | property | name of property to read |
- Returns
- true if the property was read successfully
- Exceptions
-
std::exception | if the property exists, but couldn't be converted |
Implements Rcs::PropertySource.
Definition at line 76 of file PropertySourceDict.cpp.
◆ getProperty() [2/5]
bool Rcs::PropertySourceDict::getProperty |
( |
std::vector< std::string > & |
out, |
|
|
const char * |
property |
|
) |
| |
|
virtual |
Read a string list value.
- Parameters
-
[out] | out | storage for read value |
[in] | property | name of property to read |
- Returns
- true if the property was read successfully
- Exceptions
-
std::exception | if the property exists, but couldn't be converted |
Implements Rcs::PropertySource.
Definition at line 93 of file PropertySourceDict.cpp.
◆ getProperty() [3/5]
bool Rcs::PropertySourceDict::getProperty |
( |
double & |
out, |
|
|
const char * |
property |
|
) |
| |
|
virtual |
Read a double value.
- Parameters
-
[out] | out | storage for read value |
[in] | property | name of property to read |
- Returns
- true if the property was read successfully, false if it doesn't exist
- Exceptions
-
std::exception | if the property exists, but couldn't be converted |
Implements Rcs::PropertySource.
Definition at line 124 of file PropertySourceDict.cpp.
◆ getProperty() [4/5]
bool Rcs::PropertySourceDict::getProperty |
( |
int & |
out, |
|
|
const char * |
property |
|
) |
| |
|
virtual |
Read an int value.
- Parameters
-
[out] | out | storage for read value |
[in] | property | name of property to read |
- Returns
- true if the property was read successfully, false if it doesn't exist
- Exceptions
-
std::exception | if the property exists, but couldn't be converted |
Implements Rcs::PropertySource.
Definition at line 140 of file PropertySourceDict.cpp.
◆ getProperty() [5/5]
bool Rcs::PropertySourceDict::getProperty |
( |
MatNd *& |
out, |
|
|
const char * |
property |
|
) |
| |
|
virtual |
Read a vector/matrix value. The variable out should be a pointer and will be set to a newly created MatNd* on success.
- Parameters
-
[out] | out | storage for read value |
[in] | property | name of property to read |
- Returns
- true if the property was read successfully, false if it doesn't exist
- Exceptions
-
std::exception | if the property exists, but couldn't be converted |
Implements Rcs::PropertySource.
Definition at line 156 of file PropertySourceDict.cpp.
◆ getPropertyBool()
bool Rcs::PropertySourceDict::getPropertyBool |
( |
const char * |
property, |
|
|
bool |
def = false |
|
) |
| |
|
virtual |
Read a boolean value, returning a default value if not found. This interface differs from the others to ease usability
- Parameters
-
[in] | property | name of property to read |
[in] | def | value to return if property doesn't exist |
- Returns
- true if the property was read successfully
- Exceptions
-
std::exception | if the property exists, but couldn't be converted |
Implements Rcs::PropertySource.
Definition at line 174 of file PropertySourceDict.cpp.
◆ onWrite()
void Rcs::PropertySourceDict::onWrite |
( |
| ) |
|
|
protected |
◆ saveXML()
void Rcs::PropertySourceDict::saveXML |
( |
const char * |
fileName, |
|
|
const char * |
rootNodeName |
|
) |
| |
|
virtual |
◆ setProperty() [1/5]
void Rcs::PropertySourceDict::setProperty |
( |
const char * |
property, |
|
|
const std::string & |
value |
|
) |
| |
|
virtual |
◆ setProperty() [2/5]
void Rcs::PropertySourceDict::setProperty |
( |
const char * |
property, |
|
|
bool |
value |
|
) |
| |
|
virtual |
◆ setProperty() [3/5]
void Rcs::PropertySourceDict::setProperty |
( |
const char * |
property, |
|
|
int |
value |
|
) |
| |
|
virtual |
◆ setProperty() [4/5]
void Rcs::PropertySourceDict::setProperty |
( |
const char * |
property, |
|
|
double |
value |
|
) |
| |
|
virtual |
◆ setProperty() [5/5]
void Rcs::PropertySourceDict::setProperty |
( |
const char * |
property, |
|
|
MatNd * |
value |
|
) |
| |
|
virtual |
Set a property to the given vector/matrix value.
If one of the dimensions of the matrix has size 1, it is interpreted as vector.
- Parameters
-
[in] | property | name of property to write. |
[in] | value | new property value. |
Implements Rcs::PropertySink.
Definition at line 254 of file PropertySourceDict.cpp.
◆ _exists
bool Rcs::PropertySourceDict::_exists |
|
private |
◆ children
◆ dict
pybind11::dict Rcs::PropertySourceDict::dict |
|
private |
◆ listChildren
std::map<std::string, std::vector<PropertySource*> > Rcs::PropertySourceDict::listChildren |
|
private |
◆ parent
◆ prefix
const char* Rcs::PropertySourceDict::prefix |
|
private |
The documentation for this class was generated from the following files: