29 #include "WPropertyObserver.h"
37 m_updateConditionConnection()
105 ( *i ).second.disconnect();
123 subs->get().insert( std::make_pair( *i,
135 l->get().insert( std::make_pair( property->getName(), property ) );
boost::shared_ptr< WSharedObjectTicketWrite< PropertyNameMap > > WriteTicket
Type for write tickets.
boost::signals2::scoped_connection m_updateConditionConnection
The connection used to get notified about m_properties updates.
virtual ~WPropertyObserver()
Destructor.
void cancelSubscriptions()
Cancels all current subscriptions and cleans m_subscriptions.
std::map< std::string, boost::shared_ptr< WPropertyBase > > PropertyNameMap
Convenience type for a set of property instances.
static boost::shared_ptr< WPropertyObserver > create()
Creates a new instance of WPropertyObserver.
std::map< boost::shared_ptr< WPropertyBase >, boost::signals2::connection >::iterator Iterator
A typedef for the correct iterator to traverse this sequence container.
WriteTicket getWriteTicket(bool suppressNotify=false) const
Returns a ticket to get write access to the contained data.
bool m_updated
True if a property fired.
WPropertyGroupBase::PropertyConstIterator PropertyConstIterator
The const iterator type of the container.
LastUpdated m_lastUpdated
The queue of properties that fired before handled() is called.
bool updated() const
Is true if one observed property fired.
std::set< std::string > m_propNames
The names of the properties which shall be observed if they are or become available.
void observe(boost::shared_ptr< WProperties > properties, std::set< std::string > names=std::set< std::string >())
Defines the property group whose children should be watched.
PropertyNameMap handled()
Resets the update flag and the list of fired properties.
Class to encapsulate boost::condition_variable_any.
virtual void notify()
Notifies all waiting threads.
WPropertyObserver()
Default constructor.
void updateSubscriptions()
Subscribes each property update condition which matches an entry in m_propNames.
void propertyUpdated(boost::shared_ptr< WPropertyBase > property)
Gets called by the update callback of the property.
boost::shared_ptr< WSharedObjectTicketRead< PropertyContainerType > > ReadTicket
Type for read tickets.
Subscriptions m_subscriptions
The subscription to each property which was subscribed.
boost::shared_ptr< WProperties > m_properties
The properties handled by this observer.