RcsPySim
A robot control and simulation library
Rcs::EmptyPropertySource Class Reference
Inheritance diagram for Rcs::EmptyPropertySource:
Collaboration diagram for Rcs::EmptyPropertySource:

Public Member Functions

virtual bool exists ()
 
virtual bool getProperty (std::string &out, const char *property)
 
bool getProperty (std::vector< std::string > &out, const char *property) override
 
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 PropertySourcegetChild (const char *prefix)
 
virtual const std::vector< PropertySource * > & getChildList (const char *prefix)
 
virtual PropertySourceclone () const
 
virtual void saveXML (const char *fileName, const char *rootNodeName)
 
- Public Member Functions inherited from Rcs::PropertySource
 PropertySource ()
 
virtual ~PropertySource ()
 

Additional Inherited Members

- Static Public Member Functions inherited from Rcs::PropertySource
static PropertySourceempty ()
 

Detailed Description

Definition at line 50 of file PropertySource.cpp.

Member Function Documentation

◆ clone()

virtual PropertySource* Rcs::EmptyPropertySource::clone ( ) const
inlinevirtual

Create an independent copy of this property source.

Returns
a copy of this property source. Must take ownership.

Implements Rcs::PropertySource.

Definition at line 98 of file PropertySource.cpp.

◆ exists()

virtual bool Rcs::EmptyPropertySource::exists ( )
inlinevirtual

Check if this property source exists in the underlying storage.

Implements Rcs::PropertySource.

Definition at line 53 of file PropertySource.cpp.

◆ getChild()

virtual PropertySource* Rcs::EmptyPropertySource::getChild ( const char *  prefix)
inlinevirtual

Obtain a child property source.

The exact meaning of this depends on the implementation. For an Xml document, it could be a child element. For a python dict, it could be a dict-typed entry.

The returned object is owned by the parent.

Implements Rcs::PropertySource.

Definition at line 87 of file PropertySource.cpp.

◆ getChildList()

virtual const std::vector<PropertySource*>& Rcs::EmptyPropertySource::getChildList ( const char *  prefix)
inlinevirtual

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 92 of file PropertySource.cpp.

◆ getProperty() [1/5]

virtual bool Rcs::EmptyPropertySource::getProperty ( std::string &  out,
const char *  property 
)
inlinevirtual

Read a string value.

Parameters
[out]outstorage for read value
[in]propertyname of property to read
Returns
true if the property was read successfully
Exceptions
std::exceptionif the property exists, but couldn't be converted

Implements Rcs::PropertySource.

Definition at line 58 of file PropertySource.cpp.

◆ getProperty() [2/5]

bool Rcs::EmptyPropertySource::getProperty ( std::vector< std::string > &  out,
const char *  property 
)
inlineoverridevirtual

Read a string list value.

Parameters
[out]outstorage for read value
[in]propertyname of property to read
Returns
true if the property was read successfully
Exceptions
std::exceptionif the property exists, but couldn't be converted

Implements Rcs::PropertySource.

Definition at line 63 of file PropertySource.cpp.

◆ getProperty() [3/5]

virtual bool Rcs::EmptyPropertySource::getProperty ( double &  out,
const char *  property 
)
inlinevirtual

Read a double value.

Parameters
[out]outstorage for read value
[in]propertyname of property to read
Returns
true if the property was read successfully, false if it doesn't exist
Exceptions
std::exceptionif the property exists, but couldn't be converted

Implements Rcs::PropertySource.

Definition at line 67 of file PropertySource.cpp.

◆ getProperty() [4/5]

virtual bool Rcs::EmptyPropertySource::getProperty ( int &  out,
const char *  property 
)
inlinevirtual

Read an int value.

Parameters
[out]outstorage for read value
[in]propertyname of property to read
Returns
true if the property was read successfully, false if it doesn't exist
Exceptions
std::exceptionif the property exists, but couldn't be converted

Implements Rcs::PropertySource.

Definition at line 72 of file PropertySource.cpp.

◆ getProperty() [5/5]

virtual bool Rcs::EmptyPropertySource::getProperty ( MatNd *&  out,
const char *  property 
)
inlinevirtual

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]outstorage for read value
[in]propertyname of property to read
Returns
true if the property was read successfully, false if it doesn't exist
Exceptions
std::exceptionif the property exists, but couldn't be converted

Implements Rcs::PropertySource.

Definition at line 77 of file PropertySource.cpp.

◆ getPropertyBool()

virtual bool Rcs::EmptyPropertySource::getPropertyBool ( const char *  property,
bool  def = false 
)
inlinevirtual

Read a boolean value, returning a default value if not found. This interface differs from the others to ease usability

Parameters
[in]propertyname of property to read
[in]defvalue to return if property doesn't exist
Returns
true if the property was read successfully
Exceptions
std::exceptionif the property exists, but couldn't be converted

Implements Rcs::PropertySource.

Definition at line 82 of file PropertySource.cpp.

◆ saveXML()

virtual void Rcs::EmptyPropertySource::saveXML ( const char *  fileName,
const char *  rootNodeName 
)
inlinevirtual

Save this property source as xml file.

Parameters
[in]fileNamename of the file to write
[in]rootNodeNamename of the xml root node

Implements Rcs::PropertySource.

Definition at line 103 of file PropertySource.cpp.


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