10#include <framework/datastore/DataStore.h>
23 typedef std::pair<std::string, DataStore::EDurability>
118 bool assign(TObject*
object,
bool replace =
false);
145 return !(*
this == other);
EStoreFlags
Flags describing behaviours of objects etc.
@ c_WriteOut
Object/array should be saved by output modules.
bool requireInput(const StoreAccessorBase &accessor)
Produce ERROR message if no entry of the given type is registered in the DataStore.
EDurability
Durability types.
static DataStore & Instance()
Instance of singleton Store.
bool createObject(TObject *object, bool replace, const StoreAccessorBase &accessor)
Create a new object/array in the DataStore or add an existing one.
bool registerEntry(const std::string &name, EDurability durability, TClass *objClass, bool array, EStoreFlags storeFlags)
Register an entry in the DataStore map.
bool optionalInput(const StoreAccessorBase &accessor)
Register the given object/array as an optional input.
Base class for StoreObjPtr and StoreArray for easier common treatment.
StoreAccessorBase(const std::string &name, DataStore::EDurability durability, TClass *objClass, bool isArray)
Constructor to access an object or array in the DataStore.
DataStore::EDurability getDurability() const
Return durability with which the object is saved in the DataStore.
DataStore::EDurability m_durability
Store durability under which the object/array is saved.
virtual bool operator!=(const StoreAccessorBase &other) const
Check if two store accessors point to a different object/array.
virtual bool operator==(const StoreAccessorBase &other) const
Check if two store accessors point to the same object/array.
const std::string & getName() const
Return name under which the object is saved in the DataStore.
bool registerInDataStore(const std::string &name, DataStore::EStoreFlags storeFlags=DataStore::c_WriteOut)
Register the object/array in the DataStore.
bool isRequired(const std::string &name="")
Ensure this array/object has been registered previously.
bool notWrittenOut() const
Returns true if this object/array should not be saved by output modules.
bool isOptional(const std::string &name="")
Tell the DataStore about an optional input.
bool m_isArray
Is this an accessor for an array?
std::string readableName() const
Convert this acessor into a readable string (for messages).
AccessorParams getAccessorParams() const
Return pair of name and durability under which stored object is saved.
virtual void clear()
Clear contents of this object.
TClass * getClass() const
The underlying object's type.
bool registerInDataStore(DataStore::EStoreFlags storeFlags=DataStore::c_WriteOut)
Register the object/array in the DataStore.
bool create(bool replace=false)
Create a default object in the data store.
virtual ~StoreAccessorBase()
Destructor.
std::string m_name
Store name under which this object/array is saved.
bool isArray() const
Is this an accessor for an array?
TClass * m_class
The underlying object's type.
std::pair< std::string, DataStore::EDurability > AccessorParams
Pair of parameters needed to find an object in the DataStore.
Abstract base class for different kinds of events.