25 #ifndef WFLAGFORWARDER_H
26 #define WFLAGFORWARDER_H
29 #include <boost/shared_ptr.hpp>
32 #include <boost/signals2/signal.hpp>
56 template <
typename T >
118 template <
typename T >
126 template <
typename T >
130 m_sourceConnection.disconnect();
131 signal_forward.disconnect_all_slots();
134 template <
typename T >
137 to->set( m_source->get() );
143 template <
typename T >
146 signal_forward( m_source->get() );
149 #endif // WFLAGFORWARDER_H
boost::shared_ptr< WFlag< T > > m_source
The source property to which all other properties are synced to.
WFlagForwarder & operator=(const WFlagForwarder &rhs)
Disallow copy assignment.
Class to have a simple notification/condition system for simple flags.
boost::signals2::connection m_sourceConnection
The signal fired by m_source upon value change.
void forward(boost::shared_ptr< WFlag< T > > to)
Forward the source property to the specified one.
WFlagForwarder(boost::shared_ptr< WFlag< T > > source)
Default constructor.
This class helps especially container module programmers to easily synchronize the value of one flag ...
void sourceChanged()
This is a callback and gets called whenever the source property has changed.
boost::signals2::signal< void(T) > signal_forward
Signal forwarding the new value.
virtual const T & get(bool resetChangeState=false)
Operator returns value of the flag.
virtual ~WFlagForwarder()
Destructor.