Lumiera 0.pre.04~rc.1
»edit your freedom«
Loading...
Searching...
No Matches
Propagator< TI > Class Template Reference

#include "lib/time/control-impl.hpp"

Description

template<class TI>
class lib::time::mutation::Propagator< TI >

Implementation building block: propagate changes to listeners.

The Propagator manages a set of callback signals, allowing to propagate notifications for changed Time values.

There are no specific requirements on the acceptable listeners, besides exposing a function-call operator to feed the changed time value to. Both Mutator and Propagator employ one primary template parameter, which is the type of the time values to be fed in and propagated.

Definition at line 126 of file control-impl.hpp.

Public Member Functions

template<class SIG >
void attach (SIG const &toNotify)
 install notification receiver
 
void disconnect ()
 disconnect any observers
 
TI operator() (TI const &changedVal) const
 publish a change
 

Private Types

typedef function< void(TI const &)> ChangeSignal
 
typedef std::vector< ChangeSignalListenerList
 

Private Attributes

ListenerList listeners_
 

Member Typedef Documentation

◆ ChangeSignal

template<class TI >
typedef function<void(TI const&)> ChangeSignal
private

Definition at line 128 of file control-impl.hpp.

◆ ListenerList

template<class TI >
typedef std::vector<ChangeSignal> ListenerList
private

Definition at line 129 of file control-impl.hpp.

Member Function Documentation

◆ attach()

template<class TI >
template<class SIG >
void attach ( SIG const &  toNotify)
inline

install notification receiver

Definition at line 137 of file control-impl.hpp.

References Propagator< TI >::listeners_.

◆ disconnect()

template<class TI >
void disconnect ( )
inline

disconnect any observers

Definition at line 145 of file control-impl.hpp.

References Propagator< TI >::listeners_.

◆ operator()()

template<class TI >
TI operator() ( TI const &  changedVal) const
inline

publish a change

Definition at line 152 of file control-impl.hpp.

References Propagator< TI >::listeners_.

Member Data Documentation

◆ listeners_

template<class TI >
ListenerList listeners_
private
+ Collaboration diagram for Propagator< TI >:

The documentation for this class was generated from the following file: