CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Member Functions | Private Attributes
sim_act::Signaler< T > Class Template Reference

#include <Signaler.h>

Inheritance diagram for sim_act::Signaler< T >:
Observer< const T * >

Public Types

typedef Observer< const T * > * slot_type
 

Public Member Functions

void connect (Observer< const T * > &iObs)
 does not take ownership of memory More...
 
void connect (Observer< const T * > *iObs)
 does not take ownership of memory More...
 
void operator() (const T *iSignal) const
 
 Signaler ()
 
 ~Signaler () override
 
- Public Member Functions inherited from Observer< const T * >
 Observer ()
 
void slotForUpdate (const T * iT)
 
virtual ~Observer ()
 

Private Member Functions

const Signaleroperator= (const Signaler &)=delete
 
 Signaler (const Signaler &)=delete
 
void update (const T *iData) override
 This routine will be called when the appropriate signal arrives. More...
 

Private Attributes

std::vector< Observer< const T * > * > observers_
 

Additional Inherited Members

Detailed Description

template<typename T>
class sim_act::Signaler< T >

Definition at line 36 of file Signaler.h.

Member Typedef Documentation

◆ slot_type

template<typename T>
typedef Observer<const T*>* sim_act::Signaler< T >::slot_type

Definition at line 38 of file Signaler.h.

Constructor & Destructor Documentation

◆ Signaler() [1/2]

template<typename T>
sim_act::Signaler< T >::Signaler ( )
inline

Definition at line 39 of file Signaler.h.

39 {}

◆ ~Signaler()

template<typename T>
sim_act::Signaler< T >::~Signaler ( )
inlineoverride

Definition at line 40 of file Signaler.h.

40 {}

◆ Signaler() [2/2]

template<typename T>
sim_act::Signaler< T >::Signaler ( const Signaler< T > &  )
privatedelete

Member Function Documentation

◆ connect() [1/2]

template<typename T>
void sim_act::Signaler< T >::connect ( Observer< const T * > &  iObs)
inline

does not take ownership of memory

Definition at line 58 of file Signaler.h.

58 { observers_.push_back(&iObs); }

Referenced by o2o_db_cfgmap.DbManagerDAQ::update_hashmap().

◆ connect() [2/2]

template<typename T>
void sim_act::Signaler< T >::connect ( Observer< const T * > *  iObs)
inline

◆ operator()()

template<typename T>
void sim_act::Signaler< T >::operator() ( const T iSignal) const
inline

Definition at line 43 of file Signaler.h.

43  {
44  typedef typename std::vector<Observer<const T*>*>::const_iterator iterator;
45  for (iterator it = observers_.begin(); it != observers_.end(); ++it) {
46  (*it)->slotForUpdate(iSignal);
47  }
48  }

Referenced by sim_act::Signaler< EndOfTrack >::update().

◆ operator=()

template<typename T>
const Signaler& sim_act::Signaler< T >::operator= ( const Signaler< T > &  )
privatedelete

◆ update()

template<typename T>
void sim_act::Signaler< T >::update ( const T )
inlineoverrideprivatevirtual

This routine will be called when the appropriate signal arrives.

Implements Observer< const T * >.

Definition at line 65 of file Signaler.h.

65 { this->operator()(iData); }

Referenced by progressbar.ProgressBar::__next__(), MatrixUtil.Matrix::__setitem__(), MatrixUtil.Steps::__setitem__(), progressbar.ProgressBar::finish(), and MatrixUtil.Steps::overwrite().

Member Data Documentation

◆ observers_

template<typename T>
std::vector<Observer<const T*>*> sim_act::Signaler< T >::observers_
private
sim_act::Signaler::operator()
void operator()(const T *iSignal) const
Definition: Signaler.h:43
sim_act::Signaler::observers_
std::vector< Observer< const T * > * > observers_
Definition: Signaler.h:67