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