 |
Belle II Software
release-05-02-19
|
12 #include <framework/database/IntervalOfValidity.h>
15 #include <unordered_set>
25 class IntraRunDependency;
155 bool checkType(
const TObject*
object)
const;
A class that describes the interval of experiments/runs for which an object in the database is valid.
TObject * m_object
Pointer to the actual payload object.
const std::string & getFilename() const
get the filename for this payload
const std::string & getChecksum() const
get the checksum of the payload.
std::string m_checksum
checksum of the payload file
@ c_Object
A ROOT file containing a object with the name of the DBStoreEntry.
bool isRequired() const
check whether this payload is required for operation
void require()
Change status of this payload to required.
IntervalOfValidity m_iov
validity of this payload
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
Class to hold one entry from the ConditionsDB in the DBStore.
unsigned int m_revision
revision of this payload
~DBStoreEntry()
Clean up memory.
void removeAccessor(DBAccessorBase *object)
Deregister an Accessor object and remove it from the list of registered objects.
bool m_isRequired
True if at least one user marked this payload as required, false if this payload is marked optional.
bool isArray() const
get whether this payload is an array of objects or a single objects
std::string m_filename
filename containing which contains the actual payload data
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...
Base class for DBObjPtr and DBArray for easier common treatment.
bool m_keep
if True this payload should not be updated unless it's really out of date.
DBStoreEntry(EPayloadType type, const std::string &name, const TClass *objClass, bool isArray, bool isRequired)
Construct a new DBStoreEntry.
EPayloadType
Possible Store entry types.
std::unordered_set< DBAccessorBase * > m_accessors
Vector of all the accessors registered with this entry.
IntraRunDependency * m_intraRunDependency
If the payload has intra run dependency this will point to the whole payload and m_object will just p...
void notifyAccessors(bool onDestruction=false)
Notify all the registered accessors.
void loadPayload(const EventMetaData &event)
Actual load the payload from file after all info is set.
bool checkType(const TObject *object) const
Check if a given TObject instance is compatible with the type of this entry.
void updatePayload(unsigned int revision, const IntervalOfValidity &iov, const std::string &filename, const std::string &checksum, const EventMetaData &event)
Update the payload information for this entry and if appropriate open the new file and extract the ob...
DBStoreEntry & operator=(const DBStoreEntry &)=delete
Also don't just assign them to each other.
static DBStoreEntry fromObject(const std::string &name, const TObject *obj, bool isRequired)
Construct a new DBStoreEntry with a requested name and an object directly.
const bool m_isArray
True if this payload is an array of objects.
Singleton class to cache database objects.
Abstract base class for different kinds of events.
const TClass *const m_objClass
Class 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...
const TClass * getClass() const
get the class of this payload
Base class for handling changing conditions during a run.
const std::string m_name
Name of this payload.
const TFile * getTFile() const
get the ROOT TFile pointer for this payload.
const std::string & getName() const
get the name of the payload
Singleton base class for the low-level interface to the database.
const EPayloadType m_payloadType
Type of this payload.
void updateObject(const EventMetaData &event)
update the payload object according to the new event information.
void registerAccessor(DBAccessorBase *object)
Register an Accessor object to be notified on changes by calling DBAccessorBase::storeEntryChanged()
bool isIntraRunDependent() const
return whether or not the payload might change even during the run
TFile * m_tfile
Pointer to the open ROOT TFile pointer for m_filename.
unsigned int getRevision() const
get the revision of the payload, this is an abitrary number which indicates the conditions version
@ 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.
bool keepUntilExpired() const
check whether the payload should be kept until expired
void resetPayload()
reset the payload to nothing