|
LDMX Software
|
Container and cache for conditions and conditions providers. More...
#include <Conditions.h>
Classes | |
| struct | CacheEntry |
| An entry to store an already loaded conditions object. More... | |
Public Member Functions | |
| Conditions (Process &) | |
| Constructor. | |
| ~Conditions () | |
| Class destructor. | |
| const ConditionsObject * | getConditionPtr (const std::string &condition_name) |
| Primary request action for a conditions object If the object is in the cache and still valid (IOV), the cached object will be returned. | |
| template<class T > | |
| const T & | getCondition (const std::string &condition_name) |
| Primary request action for a conditions object If the object is in the cache and still valid (IOV), the cached object will be returned. | |
| ConditionsIOV | getConditionIOV (const std::string &condition_name) const |
| Access the IOV for the given condition. | |
| void | onProcessStart () |
| Calls onProcessStart for all ConditionsObjectProviders. | |
| void | onProcessEnd () |
| Calls onProcessEnd for all ConditionsObjectProviders. | |
| void | onNewRun (ldmx::RunHeader &) |
| Calls onNewRun for all ConditionsObjectProviders. | |
| void | createConditionsObjectProvider (const std::string &classname, const std::string &instancename, const std::string &tagname, const framework::config::Parameters ¶ms) |
| Create a ConditionsObjectProvider given the information. | |
Private Attributes | |
| Process & | process_ |
| Handle to the Process. | |
| std::map< std::string, std::shared_ptr< ConditionsObjectProvider > > | provider_map_ |
| Map of who provides which condition. | |
| std::map< std::string, CacheEntry > | cache_ |
| Conditions cache. | |
Container and cache for conditions and conditions providers.
Definition at line 43 of file Conditions.h.
| framework::Conditions::Conditions | ( | Process & | p | ) |
| framework::Conditions::~Conditions | ( | ) |
Class destructor.
Releases all cached conditions objects via their providers.
Definition at line 12 of file Conditions.cxx.
References cache_.
| void framework::Conditions::createConditionsObjectProvider | ( | const std::string & | classname, |
| const std::string & | instancename, | ||
| const std::string & | tagname, | ||
| const framework::config::Parameters & | params ) |
Create a ConditionsObjectProvider given the information.
Definition at line 21 of file Conditions.cxx.
References process_, and provider_map_.
Referenced by framework::Process::Process().
|
inline |
Primary request action for a conditions object If the object is in the cache and still valid (IOV), the cached object will be returned.
If it is not in the cache, or is out of date, the ConditionsObjectProvider::getCondition method will be called to provide the object.
| T | type to cast condition object to |
| [in] | condition_name | name of condition to retrieve |
Definition at line 85 of file Conditions.h.
References getConditionPtr().
Referenced by framework::EventProcessor::getCondition().
| ConditionsIOV framework::Conditions::getConditionIOV | ( | const std::string & | condition_name | ) | const |
Access the IOV for the given condition.
| [in] | condition_name | name of condition to get IOV for |
Definition at line 52 of file Conditions.cxx.
References cache_.
Referenced by framework::ConditionsObjectProvider::requestParentCondition().
| const ConditionsObject * framework::Conditions::getConditionPtr | ( | const std::string & | condition_name | ) |
Primary request action for a conditions object If the object is in the cache and still valid (IOV), the cached object will be returned.
If it is not in the cache, or is out of date, the ConditionsObjectProvider::getCondition method will be called to provide the object.
| Exception | if condition object or provider for that object is not found. |
| [in] | condition_name | name of condition to retrieve |
Definition at line 62 of file Conditions.cxx.
References cache_, framework::Process::getEventHeader(), ldmx::EventHeader::getEventNumber(), ldmx::EventHeader::getRun(), framework::Conditions::CacheEntry::iov_, ldmx::EventHeader::isRealData(), framework::Conditions::CacheEntry::obj_, process_, framework::Conditions::CacheEntry::provider_, and provider_map_.
Referenced by getCondition(), and framework::ConditionsObjectProvider::requestParentCondition().
| void framework::Conditions::onNewRun | ( | ldmx::RunHeader & | rh | ) |
Calls onNewRun for all ConditionsObjectProviders.
Definition at line 48 of file Conditions.cxx.
References provider_map_.
Referenced by framework::Process::newRun().
| void framework::Conditions::onProcessEnd | ( | ) |
Calls onProcessEnd for all ConditionsObjectProviders.
Definition at line 44 of file Conditions.cxx.
References provider_map_.
| void framework::Conditions::onProcessStart | ( | ) |
Calls onProcessStart for all ConditionsObjectProviders.
Definition at line 40 of file Conditions.cxx.
References provider_map_.
Referenced by framework::Process::run().
|
private |
Conditions cache.
Definition at line 140 of file Conditions.h.
Referenced by getConditionIOV(), getConditionPtr(), and ~Conditions().
|
private |
Handle to the Process.
Definition at line 121 of file Conditions.h.
Referenced by createConditionsObjectProvider(), and getConditionPtr().
|
private |
Map of who provides which condition.
Definition at line 125 of file Conditions.h.
Referenced by createConditionsObjectProvider(), getConditionPtr(), onNewRun(), onProcessEnd(), and onProcessStart().