 |
Belle II Software
release-05-02-19
|
12 #include <framework/database/DBStoreEntry.h>
13 #include <framework/datastore/DataStore.h>
14 #include <framework/datastore/StoreObjPtr.h>
15 #include <framework/dataobjects/EventMetaData.h>
17 #include <boost/optional.hpp>
20 #include <unordered_map>
58 template<
class T>
static std::string
objectName(
const std::string& name) {
return DataStore::objectName<T>(name); }
64 template<
class T>
static std::string
arrayName(
const std::string& name) {
return DataStore::arrayName<T>(name); }
85 const TClass* objClass,
bool array,
bool required =
true);
100 DBStoreEntry*
getEntry(
const std::string& name,
const TClass* objClass,
101 bool array,
bool required =
true)
117 void update(
const EventMetaData& event);
140 void reset(
bool keepEntries =
false);
173 std::unordered_map<std::string, DBStoreEntry>
m_dbEntries;
@ c_Object
A ROOT file containing a object with the name of the DBStoreEntry.
void addConstantOverride(const std::string &name, TObject *obj, bool oneRun=false)
Add constant override payload.
static std::string arrayName(const std::string &name)
Return the database name for an object of the given type and name.
void reset(bool keepEntries=false)
Invalidate all payloads.
EPayloadType
Possible Store entry types.
DBStoreEntry * getEntry(DBStoreEntry::EPayloadType payloadType, const std::string &name, const TClass *objClass, bool array, bool required=true)
Returns the entry with the requested name in the DBStore.
void performUpdate(const EventMetaData &event)
The main code that does an update, factored out so it can be used by both update and update(event).
static std::string objectName(const std::string &name)
Return the database name for an object of the given type and name.
StoreObjPtr< EventMetaData > m_storeEvent
StoreObjPtr for the EventMetaData to get the current experiment and run from the DataStore.
Singleton class to cache database objects.
Abstract base class for different kinds of events.
Type-safe access to single objects in the data store.
static DBStore & Instance()
Instance of a singleton DBStore.
std::unordered_map< std::string, DBStoreEntry > m_dbEntries
Map names to DBEntry objects.
void updateEvent()
Updates all intra-run dependent objects.
void performUpdateEvent(const EventMetaData &event)
The main code that does an updateEvent.
boost::optional< EventMetaData > m_manualEvent
Optional EventMetaData variable.
DBStore()
Hidden constructor, as it is a singleton.
std::set< DBStoreEntry * > m_intraRunDependencies
List of intra-run dependent conditions.
static bool s_DoCleanup
Global flag to decide if we can do normal cleanup.
void update()
Updates all objects that are outside their interval of validity.