47 #ifndef _MIRA_PROPERTYMANAGER_H_ 48 #define _MIRA_PROPERTYMANAGER_H_ 53 #include <boost/scoped_ptr.hpp> 54 #include <boost/algorithm/string/split.hpp> 60 #include <serialization/adapters/std/list> 117 template <
typename T>
123 MIRA_THROW(XLogical,
"The property '" << name <<
"' does not exist");
124 node->
set(value, timeout);
139 template <
typename T>
144 MIRA_THROW(XLogical,
"The property '" << name <<
"' does not exist");
176 return mRoot->findChildNode(name);
183 return mRoot->findChildNode(name);
203 if ( node->
type() != typeName<T>() )
205 << typeName<T>() <<
"' for property '" << name
206 <<
"' does not match its real type '" 207 << node->
type() <<
"'");
223 boost::scoped_ptr<PropertyNode> mRoot;
Abstract base class for all derived property node classes.
Definition: PropertyNode.h:212
tick_type milliseconds() const
Returns normalized number of milliseconds (0..999)
Definition: Time.h:285
const TypedPropertyNode< T > * getPropertyNode(const std::string &name) const
Returns a typed PropertyNode that represents the specified property.
Definition: PropertyManager.h:198
specialize cv::DataType for our ImgPixel and inherit from cv::DataType<Vec>
Definition: IOService.h:67
T getProperty(const std::string &name) const
Obtains the value of the specified property.
Definition: PropertyManager.h:140
Get compiler and platform independent typenames.
#define MIRA_THROW(ex, msg)
Macro for throwing an exception.
Definition: Exception.h:78
TypedPropertyNode< T > * getPropertyNode(const std::string &name)
Returns the PropertyNode that represents the specified property.
Definition: PropertyManager.h:215
PropertyManager()
Definition: PropertyManager.h:86
const Typename & type() const
Returns the type of this property as Typename.
Definition: PropertyNode.h:151
Commonly used exception classes.
Serializer that handles properties and creates PropertyNodes.
void addObject(const char *name, T &object)
Add the specified object to the PropertyManager under the specified name.
Definition: PropertyManager.h:96
const PropertyNode * getPropertyNode(const std::string &name) const
Returns the PropertyNode that represents the specified property.
Definition: PropertyManager.h:175
Core class of the logging library.
Use this class to represent time durations.
Definition: Time.h:106
A special node that acts only as (empty) root node for a property tree.
Definition: PropertyNode.h:463
A special PropertyReflector that creates a PropertyNode for each reflected property.
Definition: PropertySerializer.h:68
const PropertyNode * getRootNode() const
Returns the root node of the managed property tree.
Definition: PropertyManager.h:154
void setProperty(const std::string &name, const T &value, const Duration &timeout=Duration::milliseconds(100))
Modifies the value of the specified property.
Definition: PropertyManager.h:118
PropertyNode * getRootNode()
Returns the root node of the managed property tree.
Definition: PropertyManager.h:161
virtual void set(const value_type &value, const Duration &timeout=Duration::milliseconds(100))=0
Sets the property to the specified value.
void reflectProperties(PropertyNode *root, const std::string &name, T &object)
Reflects the properties of the specified 'object'.
Definition: PropertySerializer.h:221
PropertyNode * getPropertyNode(const std::string &name)
Returns the PropertyNode that represents the specified property.
Definition: PropertyManager.h:182
virtual value_type get() const =0
Returns the value of the property.
Abstract base class for all typed property nodes.
Definition: PropertyNode.h:72
The property manager maintains the properties of objects that are added to the manager.
Definition: PropertyManager.h:82