Classes | Modules | Functions
Property Interface
Task Context Interface
Collaboration diagram for Property Interface:

Classes

class  RTT::ConfigurationInterface
 A class for keeping track of Attribute, Constant and Property objects of a TaskContext. It allows plugins and remote components to browse the attributes and properties of a TaskContext. More...
class  RTT::Property< T >
 A property represents a named value of any type with a description. More...
class  RTT::PropertyBag
 A container for holding references to properties. More...

Modules

 Recursive Property Bag Operations.

Functions

bool RTT::copyProperties (PropertyBag &target, const PropertyBag &source)
void RTT::deleteProperties (PropertyBag &target)
void RTT::deletePropertyBag (PropertyBag &target)
PropertyBase * RTT::findProperty (const PropertyBag &bag, const std::string &nameSequence, const std::string &separator)
void RTT::flattenPropertyBag (PropertyBag &target, const std::string &separator)
vector< string > RTT::listProperties (const PropertyBag &source, const std::string &separator)
vector< string > RTT::listPropertyDescriptions (const PropertyBag &source, const std::string &separator)
bool RTT::refreshProperties (const PropertyBag &target, const PropertyBag &source, bool allprops)
bool RTT::refreshProperty (const PropertyBag &target, const PropertyBase &source)
bool RTT::refreshProperty (PropertyBag &target, const PropertyBag &source, const std::string &name, const std::string &separator)
bool RTT::removeProperty (PropertyBag &bag, const std::string &path, const std::string &separator)
bool RTT::storeProperty (PropertyBag &bag, const std::string &path, base::PropertyBase *item, const std::string &separator)
bool RTT::updateProperties (PropertyBag &target, const PropertyBag &source)
bool RTT::updateProperty (PropertyBag &target, const PropertyBag &source, const std::string &name, const std::string &separator)

Detailed Description

Properties can be hierarchically stored and be introspected for their type and contents. Properties can be (de-)serialised using Marshallers and Demarshallers.


Function Documentation

RTT_API bool RTT::copyProperties ( PropertyBag &  target,
const PropertyBag &  source 
)

This function copies (recursively) the Properties of one Bag into another Bag. This may cause duplicate entries in target if source contains Properties with the same name. Use updateProperties to avoid duplicates and update exiting Properties.

Parameters:
targetThe bag in which the properties must be copied.
sourceThe bag containing properties for target.

Definition at line 542 of file PropertyBag.cpp.

RTT_API void RTT::deleteProperties ( PropertyBag &  target)

This function iterates over a PropertyBag and deletes all Property objects in it without recursion. This function respects ownership, that is, it deletes the properties that are not owned by target and simply removes properties which are owned by target, such that target can do the cleanup.

Postcondition:
All objects in this bag are deleted and no elements reside in the bag anymore.

Definition at line 742 of file PropertyBag.cpp.

RTT_API void RTT::deletePropertyBag ( PropertyBag &  target)

This function iterates over a PropertyBag and recursively deletes all Property objects. This function respects ownership, that is, it deletes the properties that are not owned by target and simply removes properties which are owned by target, such that target can do the cleanup.

Postcondition:
All objects in this bag (and possible subbags) are deleted and no elements reside in the bag anymore.

Definition at line 756 of file PropertyBag.cpp.

RTT_API base::PropertyBase * RTT::findProperty ( const PropertyBag &  bag,
const std::string &  path,
const std::string &  separator = std::string(".") 
)

This function locates a Property in nested PropertyBags.

Parameters:
bagThe bag to look for a Property.
pathA sequence of names, separated by separator indicating the path in the bag to a property, omitting the name of the bag itself.
separatorThe token to separate properties in the path, Defaults to ".".

Definition at line 309 of file PropertyBag.cpp.

RTT_API void RTT::flattenPropertyBag ( PropertyBag &  target,
const std::string &  separator = "." 
)

This function flattens a PropertyBag recursively. The names of the Propety objects of the included bags are placed in this bag with the included bag's name prefixed. If the Property object in that bag is also a bag, the same operation is performed recursively. So any bag in target will show up at the root of target with the path prefixed.

Definition at line 774 of file PropertyBag.cpp.

RTT_API std::vector< std::string > RTT::listProperties ( const PropertyBag &  source,
const std::string &  separator 
)

List all properties in a PropertyBag in a single list. The returned list has the form 'item1'...'subbag.subsubbag.itemN', where item1 is a property in bag, subbag is a bag inside bag and subsubbag is a bag in subbag. And so on.

Parameters:
bagThe bag to list the properties of.
separatorThe token to separate properties in the path, Defaults to ".".

Definition at line 374 of file PropertyBag.cpp.

RTT_API std::vector< std::string > RTT::listPropertyDescriptions ( const PropertyBag &  bag,
const std::string &  separator = std::string(".") 
)

List all descriptions of properties in a PropertyBag in a single list. The returned list has the same number of items returned by listProperties(bag) and matches its descriptions 1-to-1 with it.

Parameters:
bagThe bag to list the property descriptions of.
separatorThe token to separate properties in the path, Defaults to ".".

Definition at line 381 of file PropertyBag.cpp.

RTT_API bool RTT::refreshProperties ( const PropertyBag &  target,
const PropertyBag &  source,
bool  strict = false 
)

This function refreshes the values of the properties in one PropertyBag with the values of the properties of another PropertyBag. No new properties will be created.

You can use this function to update the properties of a fixed bag.

Parameters:
targetThe bag in which the properties must be refreshed.
sourceThe bag containing new values for target.
strictSet to true if each property of target must be updated with a property of source. If a property from target is not present in source, this function returns false.

Definition at line 494 of file PropertyBag.cpp.

RTT_API bool RTT::refreshProperty ( const PropertyBag &  target,
const base::PropertyBase &  source 
)

Refresh one Property in the target bag with the new value.

Parameters:
targetThe bag in which a property with name source->getName() can be found.
sourceA property which contains a new value for a property with the same name in target.

Definition at line 531 of file PropertyBag.cpp.

RTT_API bool RTT::refreshProperty ( PropertyBag &  target,
const PropertyBag &  source,
const std::string &  path,
const std::string &  separator = "." 
)

This function refreshes (recursively) the values of a single Property object of one Bag with the property of another bag. It will not create a new Property instances if the Property is not present in the target and hence fail in that case.

Parameters:
targetThe bag in which the property exists and must be refreshed.
sourceThe bag containing prop as one of its children.
pathThe path to a property in source (or in a sub-bag of source), which must be created or updated in target.
separatorThe token to separate properties in the path,

Definition at line 687 of file PropertyBag.cpp.

RTT_API bool RTT::removeProperty ( PropertyBag &  bag,
const std::string &  path,
const std::string &  separator = std::string(".") 
)

Removes a property from a bag given a certain path. This allows you to remove a property directly in (nested) subbags, instead of browsing manually to the required level and then calling PropertyBag::removeProperty().

See also:
PropertyBag::removeProperty()
Examples:
/home/rosbuild/hudson/workspace/doc-groovy-orocos_toolchain/doc_stacks/2014-10-06_03-10-10.952636/orocos_toolchain/rtt/rtt/ConfigurationInterface.hpp.

Definition at line 420 of file PropertyBag.cpp.

RTT_API bool RTT::storeProperty ( PropertyBag &  bag,
const std::string &  path,
base::PropertyBase *  item,
const std::string &  separator = std::string(".") 
)

Stores a property in a bag given a certain path with transfer of ownership. This allows you to store a property directly in (nested) subbags, instead of browsing manually to the required level and then calling PropertyBag::ownProperty().

See also:
PropertyBag::ownProperty()

Definition at line 388 of file PropertyBag.cpp.

RTT_API bool RTT::updateProperties ( PropertyBag &  target,
const PropertyBag &  source 
)

This function updates (recursively) the values of Property objects of one Bag with the values of Property objects of another bag. It creates new Property instances if a Property is not present in the target and updates existing Properties.

Use copyProperties if you want complete duplication.

Parameters:
targetThe bag in which the properties must be updated.
sourceThe bag containing new values, descriptions or properties for target.

Definition at line 561 of file PropertyBag.cpp.

RTT_API bool RTT::updateProperty ( PropertyBag &  target,
const PropertyBag &  source,
const std::string &  path,
const std::string &  separator = "." 
)

This function updates (recursively) the values of a single Property object of one Bag with the property of another bag. It creates a new Property instances if the Property is not present in the target and updates existing Properties.

Use copyProperties if you want complete duplication.

Parameters:
targetThe bag in which the property must be updated.
sourceThe bag containing prop as one of its children.
pathThe path to a property in source (or in a sub-bag of source), which must be created or updated in target.
separatorThe token to separate properties in the path,

Definition at line 630 of file PropertyBag.cpp.



rtt
Author(s): RTT Developers
autogenerated on Mon Oct 6 2014 03:13:57