10#include <framework/database/IntervalOfValidity.h>
11#include <framework/database/IntraRunDependency.h>
14#include <unordered_set>
163 bool checkType(
const TObject*
object)
const;
Base class for DBObjPtr and DBArray for easier common treatment.
Class to hold one entry from the ConditionsDB in the DBStore.
bool keepUntilExpired() const
check whether the payload should be kept until expired
void removeAccessor(DBAccessorBase *object)
Deregister an Accessor object and remove it from the list of registered objects.
const TClass * getClass() const
get the class of this payload
std::unordered_set< DBAccessorBase * > m_accessors
Vector of all the accessors registered with this entry.
const TFile * getTFile() const
get the ROOT TFile pointer for this payload.
EPayloadType
Possible Store entry types.
@ c_RawFile
Just a plain old file, we don't look at it just provide the filename.
@ c_ROOTFile
Normal ROOT file but no extraction of any specific object.
@ c_Object
A ROOT file containing a object with the name of the DBStoreEntry.
const std::string & getFilename() const
get the filename for this payload
const std::string & getName() const
get the name of the payload
bool isIntraRunDependent() const
return whether or not the payload might change even during the run
IntraRunDependency * m_intraRunDependency
If the payload has intra run dependency this will point to the whole payload and m_object will just p...
DBStoreEntry(const DBStoreEntry &)=delete
Don't copy the entries around.
IntervalOfValidity m_iov
validity of this payload
unsigned int m_revision
revision of this payload
void registerAccessor(DBAccessorBase *object)
Register an Accessor object to be notified on changes by calling DBAccessorBase::storeEntryChanged()
DBStoreEntry(EPayloadType type, const std::string &name, const TClass *objClass, bool isArray, bool isRequired)
Construct a new DBStoreEntry.
std::string m_checksum
checksum of the payload file
DBStoreEntry & operator=(const DBStoreEntry &)=delete
Also don't just assign them to each other.
const std::string m_name
Name of this payload.
IntervalOfValidity getIoV() const
get the validity of the payload
TObject * releaseObject()
Return the pointer to the current object and release ownership: The caller is responsible to clean up...
void require()
Change status of this payload to required.
bool m_keep
if True this payload should not be updated unless it's really out of date.
unsigned int getRevision() const
get the revision of the payload, this is an abitrary number which indicates the conditions version
bool isRequired() const
check whether this payload is required for operation
const EPayloadType m_payloadType
Type of this payload.
TFile * m_tfile
Pointer to the open ROOT TFile pointer for m_filename.
const TObject * getObject() const
get the object for this payload, can be nullptr if the payload is not loaded or not of type c_Object
std::string m_filename
filename containing which contains the actual payload data
const std::vector< unsigned int > getIntraRunBoundaries() const
return the boundaries of the intra-run changes of the payload, if any
const std::string & getGlobaltag() const
get the globaltag name (or testing payloads path) from which the payload is picked.
const bool m_isArray
True if this payload is an array of objects.
const std::string & getChecksum() const
get the checksum of the payload.
std::string m_globaltag
globaltag name (or testing payloads path) from which this payload is picked.
bool isArray() const
get whether this payload is an array of objects or a single objects
const TClass *const m_objClass
Class of this payload.
DBStoreEntry(DBStoreEntry &&)=default
But we're fine with moving them.
TObject * m_object
Pointer to the actual payload object.
bool m_isRequired
True if at least one user marked this payload as required, false if this payload is marked optional.
Singleton class to cache database objects.
Singleton base class for the low-level interface to the database.
A class that describes the interval of experiments/runs for which an object in the database is valid.
Base class for handling changing conditions during a run.
virtual const std::vector< unsigned int > & getBoundaries() const =0
Get a vector with the intra-run boundaries.
void notifyAccessors(bool onDestruction=false)
Notify all the registered accessors.
void resetPayload()
reset the payload to nothing
bool checkType(const TObject *object) const
Check if a given TObject instance is compatible with the type of this entry.
void updateObject(const EventMetaData &event)
update the payload object according to the new event information.
~DBStoreEntry()
Clean up memory.
void overrideObject(TObject *obj, const IntervalOfValidity &iov)
Set an override object in case we want to use a different object then actually provided by the databa...
static DBStoreEntry fromObject(const std::string &name, const TObject *obj, bool isRequired)
Construct a new DBStoreEntry with a requested name and an object directly.
void loadPayload(const EventMetaData &event)
Actual load the payload from file after all info is set.
void updatePayload(unsigned int revision, const IntervalOfValidity &iov, const std::string &filename, const std::string &checksum, const std::string &globaltag, const EventMetaData &event)
Update the payload information for this entry and if appropriate open the new file and extract the ob...
Abstract base class for different kinds of events.