25 #ifndef WPROPERTYGROUPBASE_H
26 #define WPROPERTYGROUPBASE_H
32 #include <boost/thread/thread.hpp>
33 #include <boost/thread/mutex.hpp>
34 #include <boost/thread/locks.hpp>
35 #include <boost/thread.hpp>
37 #include "WConditionSet.h"
38 #include "WPropertyBase.h"
39 #include "WPropertyTypes.h"
40 #include "WPropertyVariable.h"
41 #include "WSharedSequenceContainer.h"
77 typedef boost::shared_ptr< WPropertyGroupBase >
SPtr;
82 typedef boost::shared_ptr< const WPropertyGroupBase >
ConstSPtr;
140 virtual boost::shared_ptr< WPropertyBase >
getProperty( std::string name );
166 virtual boost::shared_ptr< WPropertyBase >
findProperty( std::string name )
const;
210 bool propNamePredicate( boost::shared_ptr< WPropertyBase > prop1, boost::shared_ptr< WPropertyBase > prop2 )
const;
231 template<
typename PropertyType >
237 typedef typename PropertyType::element_type::ValueType
ValueType;
251 new typename PropertyType::element_type( name, description, initial )
260 #endif // WPROPERTYGROUPBASE_H
boost::shared_ptr< const WPropertyGroupBase > ConstSPtr
Convenience typedef for a boost::shared_ptr< const WPropertyGroupBase >.
bool propNamePredicate(boost::shared_ptr< WPropertyBase > prop1, boost::shared_ptr< WPropertyBase > prop2) const
Compares the names of two properties and returns true if they are equal.
WSharedSequenceContainer< PropertyContainerType > PropertySharedContainerType
The alias for a shared container.
std::vector< boost::shared_ptr< WPropertyBase > > PropertyContainerType
For shortening: a type defining a shared vector of WSubject pointers.
PropertyContainerType::iterator PropertyIterator
The iterator type of the container.
static void createAndAdd(WPropertyGroupBase *group, std::string name, std::string description, const ValueType &initial=ValueType())
Actually does the work and adds a new property with the given name, description and other parameters ...
boost::shared_ptr< WPropertyGroupBase > SPtr
Convenience typedef for a boost::shared_ptr< WPropertyGroupBase >.
boost::function< void(std::string, std::string)> PropertyStringVisitor
The visitor type used to visit properties as strings.
virtual void visitAsString(PropertyStringVisitor visitor, std::string pathPrefix="") const
Visit all leafs in the property three that aren't empty groups.
PropertySharedContainerType m_properties
The set of proerties.
void addArbitraryProperty(WPropertyBase::SPtr prop)
Insert the specified property into the list.
virtual PropertySharedContainerType::ReadTicket getProperties() const
Returns a read ticket for read-access to the list of properties.
virtual bool existsProperty(std::string name)
Helper function that finds a property by its name.
This is the base class and interface for property groups.
Comfortable template to create a property instance and add it to the group.
Abstract base class for all properties.
WPropertyGroupBase(std::string name, std::string description)
Constructor.
boost::shared_ptr< WPropertyBase > SPtr
Convenience typedef for a boost::shared_ptr< WPropertyBase >
static const std::string separator
The separator used to separate groups and subgroups.
virtual boost::shared_ptr< WPropertyBase > findProperty(std::string name) const
Searches the property with a given name.
PropertyType::element_type::ValueType ValueType
The type of the initial value.
virtual boost::shared_ptr< WPropertyBase > getProperty(std::string name)
Function searches the property.
PropertyContainerType::const_iterator PropertyConstIterator
The const iterator type of the container.
virtual PropertySharedContainerType::ReadTicket getReadTicket() const
Returns an read ticket for the properties.
boost::shared_ptr< WSharedObjectTicketRead< PropertyContainerType > > ReadTicket
Type for read tickets.
virtual ~WPropertyGroupBase()
Destructor.