Belle II Software light-2406-ragdoll
|
Class for importing array of objects to the database. More...
#include <DBImportArray.h>
Public Types | |
typedef ObjArrayIterator< TClonesArray, T > | iterator |
STL-like iterator over the T objects (not T* ). | |
typedef ObjArrayIterator< const TClonesArray, const T > | const_iterator |
STL-like const_iterator over the T objects (not T* ). | |
Public Member Functions | |
DBImportArray (const std::string &name="") | |
Constructor. | |
~DBImportArray () | |
Destructor. | |
int | getEntries () const |
Returns number of objects in the array. | |
T * | appendNew () |
Construct a new T object at the end of the array. | |
template<class ... Args> | |
T * | appendNew (Args &&... params) |
Construct a new T object at the end of the array. | |
T * | operator[] (int i) const |
Access to the stored objects. | |
iterator | begin () |
Returns iterator to first entry. | |
iterator | end () |
Returns iterator to last entry +1. | |
const_iterator | begin () const |
Returns const_iterator to first entry. | |
const_iterator | end () const |
Returns const_iterator to last entry +1. | |
void | addEventDependency (unsigned int eventNumber) override |
add event dependency | |
void | addTimeStampDependency (unsigned long long int timeStamp) override |
add time stamp dependency | |
void | addSubrunDependency (int subrun) override |
add subrun dependency | |
void | clear () override |
Clear the content, e.g. | |
const std::string & | getName () const |
Returns the name under which the object will be stored in the database. | |
bool | import (const IntervalOfValidity &iov) |
Import the object to database. | |
Protected Types | |
enum | EIntraRunDependency { c_None = 0 , c_Event = 1 , c_TimeStamp = 2 , c_Subrun = 3 } |
Intra run dependency types (used only internaly) More... | |
Protected Member Functions | |
void | addIntraRunDependency (unsigned long long int tag, EIntraRunDependency type) |
add intra run dependency | |
Protected Attributes | |
std::string | m_name |
object or array name in database | |
TObject * | m_object = 0 |
pointer to allocated object or array | |
Private Member Functions | |
T * | nextFreeAdress () |
Returns address of the next free position of the array. | |
template<class IntraRun > | |
bool | import (const IntervalOfValidity &iov) |
Import intra run dependent object to database. | |
bool | storeData (TObject *intraRun, const IntervalOfValidity &iov) |
Store intra run dependent objects. | |
Private Attributes | |
EIntraRunDependency | m_dependency = c_None |
dependency type | |
std::vector< TObject * > | m_objects |
container for intra run dependency objects | |
std::vector< unsigned long long int > | m_tags |
container for intra run dep. | |
Class for importing array of objects to the database.
Note that the array is NOT parked at DBStore, but allocated internally.
Definition at line 25 of file DBImportArray.h.
typedef ObjArrayIterator<const TClonesArray, const T> const_iterator |
STL-like const_iterator over the T objects (not T* ).
Definition at line 31 of file DBImportArray.h.
typedef ObjArrayIterator<TClonesArray, T> iterator |
STL-like iterator over the T objects (not T* ).
Definition at line 29 of file DBImportArray.h.
|
protectedinherited |
Intra run dependency types (used only internaly)
Definition at line 86 of file DBImportBase.h.
|
inlineexplicit |
Constructor.
name | Name under which the array will be stored in the database |
Definition at line 37 of file DBImportArray.h.
|
inline |
|
inlineoverridevirtual |
add event dependency
eventNumber | event number |
Reimplemented from DBImportBase.
Definition at line 125 of file DBImportArray.h.
|
protectedinherited |
add intra run dependency
tag | according to type: event number or time stamp or subrun number |
type | intra run dependency type |
Definition at line 17 of file DBImportBase.cc.
|
inlineoverridevirtual |
add subrun dependency
subrun | subrun number |
Reimplemented from DBImportBase.
Definition at line 145 of file DBImportArray.h.
|
inlineoverridevirtual |
add time stamp dependency
timeStamp | time stamp |
Reimplemented from DBImportBase.
Definition at line 135 of file DBImportArray.h.
|
inline |
Construct a new T object at the end of the array.
Appends a new object to the array, and returns a pointer so it can be filled with data. The default constructor is used for the object's creation.
Definition at line 67 of file DBImportArray.h.
|
inline |
Construct a new T object at the end of the array.
This is done by forwarding all arguments to the constructor of the type T. If there is a constructor which takes the given combination of arguments then this call will succeed, otherwise it fails on compilation.
This method imposes no overhead as no temporary has to be constructed and should be the preferred solution for creating new objects.
Definition at line 80 of file DBImportArray.h.
|
inline |
Returns iterator to first entry.
Definition at line 104 of file DBImportArray.h.
|
inline |
Returns const_iterator to first entry.
Definition at line 114 of file DBImportArray.h.
|
inlineoverridevirtual |
Clear the content, e.g.
destroy allocated objects and prepare for the new DB import.
Reimplemented from DBImportBase.
Definition at line 154 of file DBImportArray.h.
|
inline |
Returns iterator to last entry +1.
Definition at line 109 of file DBImportArray.h.
|
inline |
|
inline |
Returns number of objects in the array.
Definition at line 54 of file DBImportArray.h.
|
inlineinherited |
Returns the name under which the object will be stored in the database.
Definition at line 41 of file DBImportBase.h.
|
inherited |
Import the object to database.
iov | interval of validity |
Definition at line 36 of file DBImportBase.cc.
|
inlineprivateinherited |
Import intra run dependent object to database.
iov | interval of validity |
Definition at line 114 of file DBImportBase.h.
|
inlineprivate |
Returns address of the next free position of the array.
Definition at line 167 of file DBImportArray.h.
|
inline |
Access to the stored objects.
Out-of-bounds accesses throw an std::out_of_range exception.
i | Array index, should be in 0..getEntries()-1 |
Definition at line 91 of file DBImportArray.h.
|
privateinherited |
Store intra run dependent objects.
This is an extra function to hide implementation details of Database.h
intraRun | pointer to the Intra Run implementation which has to inherit from TObject |
iov | interval of validity |
Definition at line 71 of file DBImportBase.cc.
|
privateinherited |
dependency type
Definition at line 137 of file DBImportBase.h.
|
protectedinherited |
object or array name in database
Definition at line 99 of file DBImportBase.h.
|
protectedinherited |
pointer to allocated object or array
Definition at line 100 of file DBImportBase.h.
|
privateinherited |
container for intra run dependency objects
Definition at line 138 of file DBImportBase.h.
|
privateinherited |