|
| OptionalDBArray (const std::string &name="") |
| Construct a new Array with a given name or with the default name which is identical to the class name of T.
|
|
int | getEntries () const |
| Get the number of objects in the array.
|
|
const T * | operator[] (int i) const |
| Access to the stored objects. More...
|
|
template<class KEY > |
const T * | getByKey (KEY(T::*method)(void) const, KEY key) const |
| Access object by key instead of by index. More...
|
|
const_iterator | begin () const |
| Return const_iterator to first entry.
|
|
const_iterator | end () const |
| Return const_iterator to last entry +1.
|
|
const std::string & | getName () const |
| Return name under which the object is saved in the DBStore.
|
|
bool | isValid () const |
| Check whether a valid object was obtained from the database. More...
|
|
| operator bool () const |
| Imitate pointer functionality.
|
|
virtual bool | operator== (const DBAccessorBase &other) const |
| Check if two store accessors point to the same object/array.
|
|
virtual bool | operator!= (const DBAccessorBase &other) const |
| Check if two store accessors point to a different object/array.
|
|
bool | hasChanged () |
| Check whether the object has changed since the last call to hasChanged of the accessor).
|
|
void | addCallback (std::function< void(const std::string &)> callback, bool onDestruction=false) |
| Add a callback method. More...
|
|
void | addCallback (std::function< void()> callback, bool onDestruction=false) |
| Add a callback method. More...
|
|
template<class T > |
void | addCallback (T *object, void(T::*callback)()) |
| Add a callback method of an object. More...
|
|
const std::string & | getGlobaltag () const |
| Return the globaltag name (or testing payloads path) this object is loaded from.
|
|
unsigned int | getRevision () const |
| Return current revision of the object.
|
|
IntervalOfValidity | getIoV () const |
| Return current IoV of the object.
|
|
const std::string & | getChecksum () const |
| Get current checksum.
|
|
const std::string & | getFilename () const |
| Get the filename this object is loaded from.
|
|
bool | isRequired () const |
| Check whether this conditions object is required (at least one user declared it as required)
|
|
|
const DBStoreEntry::EPayloadType | m_type |
| Type of the payload.
|
|
const std::string | m_name |
| Name of the payload in the database.
|
|
const TClass * | m_objClass |
| Class of the payload if type is c_Object.
|
|
const bool | m_isArray |
| True if the payload is an array of objects.
|
|
const bool | m_isRequired |
| True if the payload is required, otherwise no errors will be raised if it cannot be found.
|
|
DBStoreEntry * | m_entry |
| Pointer to the entry in the DBStore.
|
|
bool | m_changed {false} |
| Internal flag whether the object has changed since we last checked.
|
|
std::vector< std::pair< std::function< void(const std::string &)>, bool > > | m_callbacks |
| List of all registered callback functions.
|
|
template<class T>
class Belle2::OptionalDBArray< T >
Optional DBArray: This class behaves the same as the DBArray except that it will not raise errors when an object could not be found in the database.
Users are responsible to check the validity of the array before using it.
This is the same as using a DBArray with full constructor arguments to specify whether it is optional but allows to use default constructor and gives a clearer intention to readers.
Definition at line 97 of file DBArray.h.