43 #include <boost/bind.hpp> 46 using namespace detail;
48 using namespace boost;
63 for ( map_t::const_iterator i =
values.begin(); i !=
values.end(); ++i ) {
64 ar->
setValue((*i)->copy( repl, inst ) );
72 for ( map_t::iterator i =
values.begin(); i !=
values.end(); ++i )
82 map_t::iterator i = find(
values.begin(),
values.end(), value );
103 if ( i !=
values.end() ) {
114 if ( i ==
values.end() )
return 0;
126 return (bag.find(name) != 0);
131 if ( bag.find( p.
getName() ) ) {
140 std::vector<std::string> ret;
146 values.insert(
values.end(), new_values.begin(), new_values.end());
159 log(
Error) <<
"You tried to add a null pointer in '"<< where <<
"' for the object '" << name <<
"'. Fix your code !"<< endlog();
bool setValue(base::AttributeBase *ab)
Transfer the ownership of an attribute to the repository.
bool hasAttribute(const std::string &name) const
Check if an attribute is present in this interface.
void clear()
Erases the whole repository.
PropertyBag * properties()
Return a bag of all properties.
Base class for all properties.
ConfigurationInterface()
Create an empty ConfigurationInterface.
A container for holding references to properties.
virtual DataSourceBase::shared_ptr getDataSource() const =0
Return a internal::DataSource which contains the same contents.
void removeAttribute(const std::string &name)
Remove an attribute from the repository.
~ConfigurationInterface()
An attribute is a minimalistic, named placeholder for data.
void loadValues(AttributeObjects const &new_values)
Adds these attributes to this repository.
base::AttributeBase * getValue(const std::string &name) const
bool chkPtr(const std::string &where, const std::string &name, const void *ptr)
A class for keeping track of Attribute, Constant and Property objects of a TaskContext.
bool removeValue(const std::string &name)
Delete a value added with setValue from the repository.
Property< T > & addProperty(const std::string &name, T &prop)
Adds a variable of any type as a property to the configuration interface.
bool hasProperty(const std::string &name) const
Check if a property is present.
AttributeNames getAttributeNames() const
Return the names of all attributes in this repository.
std::vector< base::AttributeBase * > AttributeObjects
A vector containing pointers to all attribute objects stored in this repository.
const std::string & getName() const
Get the name of the property.
std::vector< typename MapT::mapped_type > values(const MapT &map)
Contains TaskContext, Activity, OperationCaller, Operation, Property, InputPort, OutputPort, Attribute.
const std::string & getName() const
Get the name of this instance.
ConfigurationInterface * copy(std::map< const base::DataSourceBase *, base::DataSourceBase * > &repl, bool instantiate) const
Return a new copy of this repository with the copy operation semantics.
bool removeProperty(base::PropertyBase &p)
Remove a previously added Property and associated attribute.