10#include <framework/database/DBImportBase.h>
11#include <framework/utilities/ArrayIterator.h>
12#include <TClonesArray.h>
40 m_object =
new TClonesArray(T::Class());
56 return static_cast<TClonesArray*
>(
m_object)->GetEntriesFast();
80 template<
class ...Args> T*
appendNew(Args&& ... params)
93 TObject* obj =
static_cast<TClonesArray*
>(
m_object)->At(i);
95 throw std::out_of_range(
"Out-of-range access in DBImportArray::operator[], for "
98 return static_cast<T*
>(obj);
128 m_object =
new TClonesArray(T::Class());
138 m_object =
new TClonesArray(T::Class());
148 m_object =
new TClonesArray(T::Class());
157 m_object =
new TClonesArray(T::Class());
Class for importing array of objects to the database.
T * nextFreeAdress()
Returns address of the next free position of the array.
const_iterator begin() const
Returns const_iterator to first entry.
T * appendNew()
Construct a new T object at the end of the array.
T * operator[](int i) const
Access to the stored objects.
DBImportArray(const std::string &name="")
Constructor.
void addTimeStampDependency(unsigned long long int timeStamp) override
add time stamp dependency
void addEventDependency(unsigned int eventNumber) override
add event dependency
ObjArrayIterator< TClonesArray, T > iterator
STL-like iterator over the T objects (not T* ).
int getEntries() const
Returns number of objects in the array.
void addSubrunDependency(int subrun) override
add subrun dependency
T * appendNew(Args &&... params)
Construct a new T object at the end of the array.
iterator end()
Returns iterator to last entry +1.
~DBImportArray()
Destructor.
const_iterator end() const
Returns const_iterator to last entry +1.
iterator begin()
Returns iterator to first entry.
void clear() override
Clear the content, e.g.
ObjArrayIterator< const TClonesArray, const T > const_iterator
STL-like const_iterator over the T objects (not T* ).
Base class for importing objects to the database.
const std::string & getName() const
Returns the name under which the object will be stored in the database.
void addIntraRunDependency(unsigned long long int tag, EIntraRunDependency type)
add intra run dependency
virtual void clear()
Clear the content, e.g.
TObject * m_object
pointer to allocated object or array
Singleton class to cache database objects.
Optimizes class to iterate over TObjArray and classes inheriting from it.
Abstract base class for different kinds of events.