38 #ifndef PI_PROPERTY_BAG 39 #define PI_PROPERTY_BAG 46 #ifdef ORO_PRAGMA_INTERFACE 119 typedef std::vector<std::string>
Names;
169 this->ownProperty( p );
208 void list(Names &names)
const;
221 return mproperties.empty();
244 const_iterator i( std::find_if(mproperties.begin(), mproperties.end(), std::bind2nd(
FindPropType<T>(), name ) ) );
245 if ( i != mproperties.end() )
256 if ( i < 0 || i >=
int(mproperties.size()) )
258 return mproperties[i];
264 size_t size()
const {
return mproperties.size(); }
296 for ( const_iterator i = mproperties.begin();
297 i != mproperties.end();
329 const std::string&
getType()
const {
return type;}
331 void setType(
const std::string& newtype) { type = newtype; }
346 Properties getProperties(
const std::string& name)
const;
353 iterator
begin() {
return mproperties.begin(); }
354 const_iterator
begin()
const {
return mproperties.begin(); }
355 iterator
end() {
return mproperties.end(); }
356 const_iterator
end()
const {
return mproperties.end(); }
365 struct FindPropType :
public std::binary_function<const base::PropertyBase*,const std::string, bool>
bool updateProperty(PropertyBag &target, const PropertyBag &source, const std::string &name, const std::string &separator)
This function updates (recursively) the values of a single Property object of one Bag with the proper...
base::PropertyBase * findValue(const T &value) const
Finds the base::PropertyBase by value.
Property< T > * getPropertyType(const std::string &name) const
Get the first Property with name name of a given type T.
bool updateProperties(PropertyBag &target, const PropertyBag &source)
This function updates (recursively) the values of Property objects of one Bag with the values of Prop...
bool ready() const
Inspect if this Property is correctly initialised and ready for usage.
bool storeProperty(PropertyBag &bag, const std::string &path, base::PropertyBase *item, const std::string &separator)
Stores a property in a bag given a certain path with transfer of ownership.
vector< string > listProperties(const PropertyBag &source, const std::string &separator)
List all properties in a PropertyBag in a single list.
PropertyBag & operator<<(base::PropertyBase *item)
The 'add' operator.
std::istream & operator>>(std::istream &is, BufferPolicy &bp)
const std::string & getType() const
bool operator()(const base::PropertyBase *b1, const std::string &b2) const
Base class for all properties.
bool copyProperties(PropertyBag &target, const PropertyBag &source)
This function copies (recursively) the Properties of one Bag into another Bag.
void setType(const std::string &newtype)
A DataSource which is used to manipulate a reference to an external value.
A container for holding references to properties.
Names getPropertyNames() const
Returns a list of all the names of the properties in this bag.
reference_t value()
Access to the value of the Property.
PropertyBase * findProperty(const PropertyBag &bag, const std::string &nameSequence, const std::string &separator)
This function locates a Property in nested PropertyBags.
void deletePropertyBag(PropertyBag &target)
This function iterates over a PropertyBag and recursively deletes all Property objects.
Property< T > & addProperty(const std::string &name, T &attr)
Adds a variable of any type as a property to this bag.
Properties PropertyContainerType
Deprecated, use Properties.
A simple introspection interface to visit PropertyBags.
vector< string > listPropertyDescriptions(const PropertyBag &source, const std::string &separator)
List all descriptions of properties in a PropertyBag in a single list.
const_iterator begin() const
A property represents a named value of any type with a description.
bool refreshProperty(const PropertyBag &target, const PropertyBase &source)
Refresh one Property in the target bag with the new value.
Properties & getProperties()
Returns a list of all the property objects in this bag.
Properties::const_iterator const_iterator
A const iterator over the Properties.
bool empty() const
Return true if no properties are present in this bag.
void flattenPropertyBag(PropertyBag &target, const std::string &separator)
This function flattens a PropertyBag recursively.
boost::intrusive_ptr< AssignableDataSource< T > > shared_ptr
Use this type to store a pointer to an AssignableDataSource.
const Properties & getProperties() const
Returns a list of all the property objects in this bag.
std::ostream & operator<<(std::ostream &os, const BufferPolicy &bp)
bool removeProperty(PropertyBag &bag, const std::string &path, const std::string &separator)
Removes a property from a bag given a certain path.
An interface which all classes which wish to visit a Property should implement.
base::PropertyBase * getItem(int i) const
Returns the i'th Property, starting from 0.
void deleteProperties(PropertyBag &target)
This function iterates over a PropertyBag and deletes all Property objects in it without recursion...
std::vector< std::string > Names
The container to hold names of Properties.
const std::string & getName() const
Get the name of the property.
Properties::iterator iterator
An iterator over the Properties.
Contains TaskContext, Activity, OperationCaller, Operation, Property, InputPort, OutputPort, Attribute.
size_t size() const
Get the number of Properties in this bag.
bool refreshProperties(const PropertyBag &target, const PropertyBag &source, bool allprops)
This function refreshes the values of the properties in one PropertyBag with the values of the proper...
const_iterator end() const
A function object for finding a Property by name and type.
std::vector< base::PropertyBase * > Properties
The container in which the properties are stored.