LCCD  1.5.0
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
lccd::ConditionsHandlerBase Class Referenceabstract

Base implementation of IConditionsHandler. More...

#include <ConditionsHandlerBase.hh>

Inheritance diagram for lccd::ConditionsHandlerBase:
lccd::IConditionsHandler lccd::DataFileHandler lccd::DBCondHandler lccd::DBFileHandler lccd::SimpleFileHandler

Public Member Functions

 ConditionsHandlerBase (const ConditionsHandlerBase &)=delete
 
ConditionsHandlerBaseoperator= (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.
 

Detailed Description

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()

Author
F.Gaede, S.Aplin, DESY
Version
Id:
ConditionsHandlerBase.hh,v 1.3 2007-04-27 13:21:31 gaede Exp

Member Function Documentation

virtual const std::string lccd::ConditionsHandlerBase::name ( )
inlinevirtual
virtual void lccd::ConditionsHandlerBase::update ( LCCDTimeStamp  timestamp)
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.

void lccd::ConditionsHandlerBase::updateEvent ( lcio::LCEvent *  evt)
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.

Member Data Documentation

lcio::LCCollection* lccd::ConditionsHandlerBase::_col = nullptr
protected
LCCDTimeStamp lccd::ConditionsHandlerBase::_validSince {}
protected
LCCDTimeStamp lccd::ConditionsHandlerBase::_validTill {}
protected

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