![]() |
Belle II Software
light-2303-iriomote
|
Base class for StoreObjPtr and StoreArray for easier common treatment. More...
#include <StoreAccessorBase.h>


Public Member Functions | |
| StoreAccessorBase (const std::string &name, DataStore::EDurability durability, TClass *objClass, bool isArray) | |
| Constructor to access an object or array in the DataStore. More... | |
| virtual | ~StoreAccessorBase () |
| Destructor. More... | |
| bool | registerInDataStore (DataStore::EStoreFlags storeFlags=DataStore::c_WriteOut) |
| Register the object/array in the DataStore. More... | |
| bool | registerInDataStore (const std::string &name, DataStore::EStoreFlags storeFlags=DataStore::c_WriteOut) |
| Register the object/array in the DataStore. More... | |
| bool | isRequired (const std::string &name="") |
| Ensure this array/object has been registered previously. More... | |
| bool | isOptional (const std::string &name="") |
| Tell the DataStore about an optional input. More... | |
| bool | create (bool replace=false) |
| Create a default object in the data store. More... | |
| bool | assign (TObject *object, bool replace=false) |
| Assign 'object' to this accessor. More... | |
| virtual void | clear () |
| Clear contents of this object. | |
| const std::string & | getName () const |
| Return name under which the object is saved in the DataStore. | |
| DataStore::EDurability | getDurability () const |
| Return durability with which the object is saved in the DataStore. | |
| AccessorParams | getAccessorParams () const |
| Return pair of name and durability under which stored object is saved. More... | |
| virtual bool | operator== (const StoreAccessorBase &other) const |
| Check if two store accessors point to the same object/array. | |
| virtual bool | operator!= (const StoreAccessorBase &other) const |
| Check if two store accessors point to a different object/array. | |
| TClass * | getClass () const |
| The underlying object's type. | |
| bool | isArray () const |
| Is this an accessor for an array? | |
| bool | notWrittenOut () const |
| Returns true if this object/array should not be saved by output modules. More... | |
| std::string | readableName () const |
| Convert this acessor into a readable string (for messages). More... | |
Protected Attributes | |
| std::string | m_name |
| Store name under which this object/array is saved. | |
| DataStore::EDurability | m_durability |
| Store durability under which the object/array is saved. | |
| TClass * | m_class |
| The underlying object's type. | |
| bool | m_isArray |
| Is this an accessor for an array? | |
Base class for StoreObjPtr and StoreArray for easier common treatment.
Definition at line 27 of file StoreAccessorBase.h.
|
inline |
Constructor to access an object or array in the DataStore.
| name | Name under which the object is stored in the DataStore. |
| durability | Decides durability map used for getting the accessed object. |
| objClass | Type of the object |
| isArray | true if the entry in the DataStore is an array |
Definition at line 37 of file StoreAccessorBase.h.
|
inlinevirtual |
Destructor.
Virtual because this is a base class.
Definition at line 44 of file StoreAccessorBase.h.
| bool assign | ( | TObject * | object, |
| bool | replace = false |
||
| ) |
Assign 'object' to this accessor.
(takes ownership).
| object | The object that should be put in the DataStore, should be of same type as the one used by this accessor. |
| replace | Should an existing object be replaced? (if existing and supplied object are equal, this has no effect) |
Definition at line 33 of file StoreAccessorBase.cc.
|
inline |
Create a default object in the data store.
This only works after registerInDataStore() has been called by this or another module.
| replace | Should an existing object be replaced? |
Definition at line 107 of file StoreAccessorBase.h.
|
inline |
Return pair of name and durability under which stored object is saved.
Definition at line 134 of file StoreAccessorBase.h.
|
inline |
Tell the DataStore about an optional input.
Mainly useful for creating diagrams of module inputs and outputs.
| name | If not empty, set non-default name for this object/array. This is permanent, so that e.g. after using registerInDataStore("myName") in initialize(), this object will continue refer to 'myName' in event(). |
Definition at line 93 of file StoreAccessorBase.h.
|
inline |
Ensure this array/object has been registered previously.
Will cause an ERROR if it does not exist. This must be called in the initialization phase.
| name | If not empty, set non-default name for this object/array. This is permanent, so that e.g. after using registerInDataStore("myName") in initialize(), this object will continue refer to 'myName' in event(). |
Definition at line 78 of file StoreAccessorBase.h.
| bool notWrittenOut | ( | ) | const |
Returns true if this object/array should not be saved by output modules.
See DataStore::c_DontWriteOut. Can be changed by re-registering it with/without the flag.
Definition at line 53 of file StoreAccessorBase.cc.
| std::string readableName | ( | ) | const |
Convert this acessor into a readable string (for messages).
e.g. "object EventMetaData (durability: event)"
Definition at line 18 of file StoreAccessorBase.cc.
|
inline |
Register the object/array in the DataStore.
This must be called in the initialization phase.
| name | If not empty, set non-default name for this object/array. This is permanent, so that e.g. after using registerInDataStore("myName") in initialize(), this object will continue refer to 'myName' in event(). |
| storeFlags | ORed combination of DataStore::EStoreFlags. |
Definition at line 64 of file StoreAccessorBase.h.
|
inline |
Register the object/array in the DataStore.
This must be called in the initialization phase.
| storeFlags | ORed combination of DataStore::EStoreFlags. |
Definition at line 52 of file StoreAccessorBase.h.