LCCD  1.5.0
IConditionsChangeListener.hh
1 #ifndef IConditionsChangeListener_h
2 #define IConditionsChangeListener_h
3 
4 #include "lcio.h"
5 #include "EVENT/LCCollection.h"
6 
7 namespace lccd {
8 
9  class ConditionsHandlerBase;
10  class IConditionsHandler;
11 
23 
24 public:
25 
26  virtual ~IConditionsChangeListener() {}
27 
28  friend class ConditionsHandlerBase;
29 
30 protected:
31 
40  virtual void conditionsChanged( lcio::LCCollection* col ) = 0 ;
41 
42 
45  virtual void registeredWithHandler( IConditionsHandler* ch ) { _handlerList.push_back( ch ); } ;
46 
47 
50  virtual void deRegisteredWithHandler( IConditionsHandler* ch ) { _handlerList.remove( ch ); } ;
51 
54  const std::list<IConditionsHandler*>& handlerList() { return _handlerList ; } ;
55 
56 private:
60  std::list<IConditionsHandler*> _handlerList{};
61 
62 };
63 
64 } //end namespace
65 
66 #endif // IConditionsChangeListener_h
virtual void deRegisteredWithHandler(IConditionsHandler *ch)
Callback called by handler when deregistered, should not be called directly.
Definition: IConditionsChangeListener.hh:50
Simple interface that allows notification of implementation classes if a conditions data set has chan...
Definition: IConditionsChangeListener.hh:22
Base implementation of IConditionsHandler.
Definition: ConditionsHandlerBase.hh:27
Abstract handler for conditions data.
Definition: IConditionsHandler.hh:26
virtual void registeredWithHandler(IConditionsHandler *ch)
Callback called by handler when registered, should not be called directly.
Definition: IConditionsChangeListener.hh:45
const std::list< IConditionsHandler * > & handlerList()
Get handler list.
Definition: IConditionsChangeListener.hh:54
virtual void conditionsChanged(lcio::LCCollection *col)=0
The callback - use updated conditions data collection as needed, e.g.