LCCD
1.5.0
|
Base implementation of IConditionsHandler. More...
#include <ConditionsHandlerBase.hh>
Public Member Functions | |
ConditionsHandlerBase (const ConditionsHandlerBase &)=delete | |
ConditionsHandlerBase & | operator= (const ConditionsHandlerBase &)=delete |
ConditionsHandlerBase (const std::string &name) | |
Default c'tor - need a name for the conditions data set. | |
virtual void | updateEvent (lcio::LCEvent *evt) |
Retrieves the new conditions data if required by evt->getTimestamp() and adds a collection to event with its name. More... | |
virtual void | update (LCCDTimeStamp timestamp)=0 |
Retrieves the new conditions data if required by timestamp. More... | |
virtual lcio::LCCollection * | currentCollection () |
Returns the current collection of conditions data. | |
virtual void | registerChangeListener (IConditionsChangeListener *cl) |
Every IConditionsChangeListener will be notified if the conditions data of this instance has changed. | |
virtual void | removeChangeListener (IConditionsChangeListener *cl) |
Remove the specified listener from list of registered listeners ;. | |
virtual bool | isChangeListenerRegistered (IConditionsChangeListener *cl) |
checks if the changeListner is Registered | |
virtual void | registerDefaultCollection (lcio::LCCollection *col)=0 |
Register a pointer to a default collection which will be passed to the IConditionsChangeListener if no data can be found for a given time stamp. | |
virtual lcio::LCCollection * | defaultCollection ()=0 |
The default collection registered with the handler. | |
virtual lcio::LCCollection * | lastValidCollection ()=0 |
The last valid collection held by the handler. | |
virtual const std::string | name () |
The name of this conditions handler - used, e.g. More... | |
virtual LCCDTimeStamp | validSince () |
First timestamp for which the current conditions data is valid. | |
virtual LCCDTimeStamp | validTill () |
Last timestamp for which the current conditions data is valid. | |
Protected Member Functions | |
virtual void | notifyListeners () |
Tell all registered listeners that the conditions data has changed. | |
Protected Attributes | |
lcio::LCCollection * | _col = nullptr |
The current collection of conditions data. More... | |
std::string | _name {} |
Name assigned with conditions data. | |
LCCDTimeStamp | _validSince {} |
First timestamp for which the current data is valid. More... | |
LCCDTimeStamp | _validTill {} |
Last timestamp for which the current data is valid. More... | |
std::vector < IConditionsChangeListener * > | _changeListeners {} |
The registered change listeners. | |
Base implementation of IConditionsHandler.
Provides common code, e.g. registration and notfication of IConditionsChangeListeners.
Subclasses need to implement the following methods: IConditionsHandler::update( LCCDTimeStamp timestamp ) IConditionsHandler::registerDefaultCollection( lcio::LCCollection* col) lcio::LCCollection* IConditionsHandler::defaultCollection() lcio::LCCollection* IConditionsHandler::lastValidCollection()
|
inlinevirtual |
The name of this conditions handler - used, e.g.
as name of the collection in update( lcio::LCEvent* evt ).
Implements lccd::IConditionsHandler.
References _name.
Referenced by lccd::SimpleFileHandler::defaultCollection(), lccd::DataFileHandler::defaultCollection(), lccd::SimpleFileHandler::lastValidCollection(), lccd::DataFileHandler::lastValidCollection(), lccd::SimpleFileHandler::registerDefaultCollection(), lccd::DataFileHandler::registerDefaultCollection(), lccd::DBCondHandler::registerDefaultCollection(), lccd::DBFileHandler::registerDefaultCollection(), lccd::SimpleFileHandler::update(), lccd::DBCondHandler::update(), lccd::DBFileHandler::update(), and lccd::DataFileHandler::updateEvent().
|
pure virtual |
Retrieves the new conditions data if required by timestamp.
Notifies all registered listeners
See implementation classes for details.
Implements lccd::IConditionsHandler.
Implemented in lccd::DBFileHandler, lccd::DBCondHandler, lccd::DataFileHandler, and lccd::SimpleFileHandler.
|
virtual |
Retrieves the new conditions data if required by evt->getTimestamp() and adds a collection to event with its name.
Notifies all registered listeners
Implements lccd::IConditionsHandler.
Reimplemented in lccd::DataFileHandler.
|
protected |
The current collection of conditions data.
Referenced by currentCollection(), lccd::DataFileHandler::DataFileHandler(), lccd::DBCondHandler::DBCondHandler(), lccd::DBFileHandler::DBFileHandler(), lccd::SimpleFileHandler::SimpleFileHandler(), lccd::SimpleFileHandler::update(), lccd::DBCondHandler::update(), lccd::DBFileHandler::update(), and lccd::DataFileHandler::updateEvent().
|
protected |
First timestamp for which the current data is valid.
Referenced by lccd::SimpleFileHandler::update(), lccd::DBCondHandler::update(), lccd::DBFileHandler::update(), lccd::DataFileHandler::updateEvent(), and validSince().
|
protected |
Last timestamp for which the current data is valid.
Referenced by lccd::SimpleFileHandler::update(), lccd::DBCondHandler::update(), lccd::DBFileHandler::update(), lccd::DataFileHandler::updateEvent(), and validTill().