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