Belle II Software development
|
Wraps a stored array/object, stored under unique (name, durability) key. More...
#include <StoreEntry.h>
Public Member Functions | |
StoreEntry (bool isArray, TClass *cl, std::string name, bool dontWriteOut) | |
useful constructor, creates 'object', but leaves 'ptr' NULL. | |
void | invalidate () |
invalidate entry for next event. | |
void | resetForGetEntry () |
Reset stored object to defaults, or nullptr. | |
void | recoverFromNullObject () |
Recreate object if null. | |
void | recreate () |
Reset stored object to defaults, set ptr to new object. | |
TClonesArray * | getPtrAsArray () const |
Return ptr cast to TClonesArray. | |
Public Attributes | |
bool | isArray |
Flag that indicates whether the object is a TClonesArray. | |
bool | dontWriteOut |
Flag that indicates whether the object should be written to the output by default. | |
TClass * | objClass |
class of object. | |
TObject * | object |
The pointer to the actual object. | |
TObject * | ptr |
The pointer to the returned object, either equal to 'object' or null, depending on wether the object was created in the current event. | |
std::string | name |
Name of the entry. | |
Wraps a stored array/object, stored under unique (name, durability) key.
See DataStore::m_storeEntryMap.
Definition at line 22 of file StoreEntry.h.
|
inline |
Definition at line 23 of file StoreEntry.h.
StoreEntry | ( | bool | isArray, |
TClass * | cl, | ||
std::string | name, | ||
bool | dontWriteOut | ||
) |
useful constructor, creates 'object', but leaves 'ptr' NULL.
Definition at line 19 of file StoreEntry.cc.
TClonesArray * getPtrAsArray | ( | ) | const |
Return ptr cast to TClonesArray.
If this is not an array, return null.
Definition at line 83 of file StoreEntry.cc.
void invalidate | ( | ) |
invalidate entry for next event.
(ptr will be null afterwards, memory may be reused.)
Definition at line 77 of file StoreEntry.cc.
void recoverFromNullObject | ( | ) |
Recreate object if null.
Used to recover from temporary invalid states after reading empty branches.
Definition at line 30 of file StoreEntry.cc.
void recreate | ( | ) |
Reset stored object to defaults, set ptr to new object.
More or less equivalent to delete object; object = new X;, but optimized.
Definition at line 68 of file StoreEntry.cc.
void resetForGetEntry | ( | ) |
Reset stored object to defaults, or nullptr.
Only useful for input modules (before GetEntry()).
Definition at line 55 of file StoreEntry.cc.
bool dontWriteOut |
Flag that indicates whether the object should be written to the output by default.
Definition at line 40 of file StoreEntry.h.
bool isArray |
Flag that indicates whether the object is a TClonesArray.
Definition at line 39 of file StoreEntry.h.
std::string name |
TClass* objClass |
class of object.
If isArray==true, class of array objects
Definition at line 41 of file StoreEntry.h.
TObject* object |
The pointer to the actual object.
Associated memory may exceed object durability, and is kept until the object is replaced. In normal use, this should never be null. Temporary exceptions are allowed for input modules.
Definition at line 48 of file StoreEntry.h.
TObject* ptr |
The pointer to the returned object, either equal to 'object' or null, depending on wether the object was created in the current event.
Definition at line 51 of file StoreEntry.h.