![]() |
Belle II Software
release-05-02-19
|
This class is for convenience access and registration of objects, that are stored inside the StoreWrapper on the DataStore. More...
#include <StoreWrappedObjPtr.h>
Public Member Functions | |
StoreWrappedObjPtr (const std::string &name="", DataStore::EDurability durability=DataStore::c_Event) | |
Constructor to access an object in the DataStore. More... | |
bool | registerInDataStore (DataStore::EStoreFlags storeFlags=DataStore::c_DontWriteOut|DataStore::c_ErrorIfAlreadyRegistered) |
Register the object/array in the DataStore. More... | |
bool | registerInDataStore (const std::string &name, DataStore::EStoreFlags storeFlags=DataStore::c_DontWriteOut|DataStore::c_ErrorIfAlreadyRegistered) |
Register the object/array in the DataStore. More... | |
T & | operator* () const |
Dereference to the wrapped object. | |
T * | operator-> () const |
Forward pointer access to the wrapped object. | |
bool | isValid () const |
Check whether the object was created. More... | |
bool | construct (Args &&... params) |
Construct an object of type T in this StoreObjPtr, using the provided constructor arguments. More... | |
bool | constructAndReplace (Args &&... params) |
Construct an object of type T in this StoreObjPtr, using the provided constructor arguments. More... | |
Static Public Member Functions | |
static std::vector< std::string > | getObjectList (DataStore::EDurability durability=DataStore::c_Event) |
Return list of object names with matching type. More... | |
Private Member Functions | |
void | ensureAttached () const |
Ensure that this object is attached. | |
void | ensureValid () const |
if accesses to this object would crash, throw an std::runtime_error | |
Private Attributes | |
TObject ** | m_storeObjPtr |
Store of actual pointer. More... | |
This class is for convenience access and registration of objects, that are stored inside the StoreWrapper on the DataStore.
It limits the user to registrations of transient store objects only, since objects wrapped by the StoreWrapper are usually not intended for streaming.
Definition at line 40 of file StoreWrappedObjPtr.h.
|
inline |
Constructor to access an object in the DataStore.
name | Name under which the object is stored in the DataStore. If an empty string is supplied, the type name will be used. |
durability | Decides durability map used for getting the accessed object. |
Definition at line 49 of file StoreWrappedObjPtr.h.
|
inlineinherited |
Construct an object of type T in this StoreObjPtr, using the provided constructor arguments.
If this StoreObjPtr already contains an object, this function will fail.
Definition at line 128 of file StoreObjPtr.h.
|
inlineinherited |
Construct an object of type T in this StoreObjPtr, using the provided constructor arguments.
If this StoreObjPtr already contains an object, it will be replaced.
Definition at line 140 of file StoreObjPtr.h.
|
inlinestaticinherited |
|
inlineinherited |
Check whether the object was created.
Definition at line 120 of file StoreObjPtr.h.
|
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::EStoreFlag flags. Defaults to c_DontWriteOut | DataStore::c_ErrorIfAlreadyRegistered. |
Definition at line 72 of file StoreWrappedObjPtr.h.
|
inline |
Register the object/array in the DataStore.
This must be called in the initialization phase.
storeFlags | ORed combination of DataStore::EStoreFlag flags. Defaults to c_DontWriteOut | c_ErrorIfAlreadyRegistered. |
Definition at line 60 of file StoreWrappedObjPtr.h.
|
privateinherited |
Store of actual pointer.
Don't make this a T** as this might cause problems with multiple inheritance objects
Definition at line 175 of file StoreObjPtr.h.