39 #ifndef RTT_CONFIGURATIONINTERFACE_HPP 40 #define RTT_CONFIGURATIONINTERFACE_HPP 90 bool hasAttribute(
const std::string& name )
const;
102 if ( !chkPtr(
"addAttribute", name, &attr) )
return false;
104 return this->addAttribute( a );
116 if ( !chkPtr(
"addAttribute", name, &attr) )
return attr;
121 this->addAttribute( attr );
122 assert(attr.
ready());
136 if ( !chkPtr(
"addConstant", name, &cnst) )
return false;
138 return this->addAttribute( a );
151 if ( !chkPtr(
"addConstant", name, &cnst) )
return cnst;
156 this->addConstant( cnst );
157 assert(cnst.
ready());
173 return this->properties()->addProperty( name, prop );
185 if ( !chkPtr(
"addProperty", name, &prop) )
return prop;
190 this->properties()->addProperty( prop );
191 assert(prop.
ready());
206 if ( !chkPtr(
"addAttribute",
"AttributeBase", &a) )
return false;
220 return this->getValue( name );
226 void removeAttribute(
const std::string& name );
247 return this->getValue( name );
253 bool hasProperty(
const std::string& name )
const;
277 return bag.find(name);
301 bool removeValue(
const std::string& name );
310 ConfigurationInterface* copy( std::map<const base::DataSourceBase*, base::DataSourceBase*>& repl,
bool instantiate )
const;
315 void loadValues( AttributeObjects
const& new_values);
327 AttributeNames getAttributeNames()
const;
335 bool chkPtr(
const std::string &where,
const std::string& name,
const void* ptr);
336 typedef std::vector<base::AttributeBase*>
map_t;
bool removeProperty(PropertyBag &bag, const std::string &path, const std::string &separator)
bool addAttribute(base::AttributeBase &a)
virtual AttributeBase * clone() const =0
Constant< T > & addConstant(const std::string &name, Constant< T > &cnst)
bool addConstant(base::AttributeBase &c)
A container for holding references to properties.
virtual DataSourceBase::shared_ptr getDataSource() const =0
std::vector< base::AttributeBase * > map_t
std::vector< std::string > AttributeNames
AttributeObjects const & getValues() const
base::PropertyBase * getProperty(const std::string &name) const
A property represents a named value of any type with a description.
base::AttributeBase * getAttribute(const std::string &name) const
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.
void setName(const std::string &name)
Property< T > & addProperty(const std::string &name, T &prop)
Property< T > & addProperty(const std::string &name, Property< T > &prop)
bool addConstant(const std::string &name, const T &cnst)
std::vector< base::AttributeBase * > AttributeObjects
base::AttributeBase * getConstant(const std::string &name) const
std::vector< typename MapT::mapped_type > values(const MapT &map)
Contains TaskContext, Activity, OperationCaller, Operation, Property, InputPort, OutputPort, Attribute.
void setName(std::string const &new_name)
Attribute< T > & addAttribute(const std::string &name, Attribute< T > &attr)
bool addAttribute(const std::string &name, T &attr)