MTC
Classes | Public Types | Public Member Functions | Static Public Member Functions | Friends | List of all members
moveit::task_constructor::Property Class Reference

#include <properties.h>

Classes

class  error
 
class  type_error
 
class  undeclared
 
class  undefined
 

Public Types

using type_info = boost::typeindex::type_info
 
using SourceFlags = uint
 
using InitializerFunction = std::function< boost::any(const PropertyMap &)>
 function callback used to initialize property value from another PropertyMap
 

Public Member Functions

 Property ()
 Construct a property holding a any value.
 
void setValue (const boost::any &value)
 set current value and default value
 
void setCurrentValue (const boost::any &value)
 
void setDefaultValue (const boost::any &value)
 
void reset ()
 reset to default value (which can be empty)
 
bool defined () const
 the current value defined or will the fallback be used?
 
const boost::any & value () const
 get current value (or default if not defined)
 
boost::any & value ()
 
const boost::any & defaultValue () const
 get default value
 
std::string serialize () const
 
const std::string & description () const
 get description text
 
void setDescription (const std::string &desc)
 
std::string typeName () const
 
bool initsFrom (SourceFlags source) const
 return true, if property initialized from given SourceId
 
PropertyconfigureInitFrom (SourceFlags source, const InitializerFunction &f)
 configure initialization from source using an arbitrary function
 
PropertyconfigureInitFrom (SourceFlags source, const std::string &name)
 configure initialization from source using given other property name
 

Static Public Member Functions

static std::string serialize (const boost::any &value)
 serialize value using registered functions
 
static boost::any deserialize (const std::string &type_name, const std::string &wire)
 
static std::string typeName (const type_info &type_info)
 get typename
 

Friends

class PropertyMap
 

Detailed Description

Property is a wrapper for a boost::any value, also providing a default value and a description.

Properties can be configured to be initialized from another PropertyMap - if still undefined. A source id allows to distinguish different initialization methods (e.g. using a different reference name) as well as to define a priority order between sources.

Setting the value via setValue() updates both, the current value and the default value. Using reset() the default value can be restored. setCurrentValue() and setDefaultValue() only set the specific value.


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