2#ifndef XAODROOTACCESS_TOOLS_AUXSTOREBASE_H
3#define XAODROOTACCESS_TOOLS_AUXSTOREBASE_H
48 const std::string&
prefix()
const;
74 std::size_t capacity)
override;
80 virtual void lock()
override;
89 virtual std::size_t
size()
const override;
104 std::size_t capacity)
override;
110 virtual bool resize(std::size_t
size)
override;
114 virtual void shift(std::size_t pos, std::ptrdiff_t offs)
override;
134 virtual void selectAux(
const std::set<std::string>& attributes);
191 std::vector<std::unique_ptr<SG::IAuxTypeVector> >
m_vecs{};
206 using guard_t = AthContainers_detail::lock_guard<mutex_t>;
An auxiliary data store that holds data internally.
Interface providing I/O for a generic auxiliary store.
Interface for non-const operations on an auxiliary store.
Interface providing I/O for a generic auxiliary store.
Interface for non-const operations on an auxiliary store.
Abstract interface for manipulating vectors of arbitrary types.
A set of aux data identifiers.
Class helping in dealing with dynamic branch selection.
virtual ~AuxStoreBase()
Destructor.
virtual const SG::auxid_set_t & getWritableAuxIDs() const override
Return a set of writable data identifiers.
virtual void setPrefix(std::string_view prefix)=0
Set the object name prefix.
virtual void reset()=0
Reset all (transient) information in the object.
virtual void shift(std::size_t pos, std::ptrdiff_t offs) override
Shift the contents of the stored arrays.
virtual const SG::IAuxTypeVector * getVector(SG::auxid_t auxid) const override
Return vector interface for one aux data item.
mutex_t m_mutex1
Mutex objects used for multithreaded synchronisation.
virtual void lockDecoration(SG::auxid_t auxid) override
Lock a decoration.
virtual const void * getIOData(SG::auxid_t auxid) const override
Get a pointer to the data being stored for one aux data item.
virtual StatusCode setupOutputData(SG::auxid_t auxid)=0
Connect a variable to the output.
virtual const void * getData(SG::auxid_t auxid) const override
Get a pointer to a given array.
AuxSelection m_selection
Object helping to select which auxiliary variables to write.
const std::string & prefix() const
Get the currently configured object name prefix.
void setTopStore(bool value=true)
Set whether the object should behave as a "top store" or not.
virtual bool hasOutput() const =0
Check if an output is being written by the object.
bool isAuxIDSelected(SG::auxid_t auxid) const
Check if an auxiliary variable is selected for ouput writing.
void setStructMode(EStructMode mode)
Set the structure mode of the object to a new value.
virtual const SG::auxid_set_t & getDecorIDs() const override
Get the types(names) of decorations handled by this container.
bool isTopStore() const
Check if the object is a "top store", or not.
virtual const std::type_info * getIOType(SG::auxid_t auxid) const override
Return the type of the data to be stored for one aux data item.
virtual bool insertMove(std::size_t pos, SG::IAuxStore &other, const SG::auxid_set_t &ignore) override
Insert contents of another store via move.
virtual SG::auxid_set_t getSelectedAuxIDs() const override
Get the IDs of the selected aux variables.
virtual const std::type_info * getInputType(SG::auxid_t auxid) const =0
Get the type of an input object, for getIOType()
virtual bool clearDecorations() override
Remove the decorations added so far.
virtual StatusCode getEntryFor(SG::auxid_t auxid)=0
Load a single variable from the input.
AthContainers_detail::mutex mutex_t
Mutex type for multithread synchronization.
EStructMode
"Structural" modes of the object
@ kUndefinedStore
The structure mode is not defined.
@ kObjectStore
The object describes a single object.
@ kContainerStore
The object describes an entire container.
virtual StatusCode setupInputData(SG::auxid_t auxid)=0
Connect a variable to the input.
virtual bool hasEntryFor(SG::auxid_t auxid) const =0
Check if a given variable is available from the input.
bool m_locked
Is this container locked?
virtual void reserve(std::size_t size) override
Reserve a given size for the arrays.
virtual bool isDecoration(SG::auxid_t auxid) const override
Test if a variable is a decoration.
virtual const SG::auxid_set_t & getDynamicAuxIDs() const override
Get the types(names) of variables created dynamically.
virtual const SG::auxid_set_t & getAuxIDs() const override
Get the types(names) of variables handled by this container.
AuxStoreBase(bool topStore=true, EStructMode mode=EStructMode::kUndefinedStore)
Constructor.
virtual const SG::IAuxTypeVector * linkedVector(SG::auxid_t auxid) const override
Return (const) interface for a linked variable.
virtual void * getDecoration(SG::auxid_t auxid, std::size_t size, std::size_t capacity) override
Get a pointer to a given array, creating the array if necessary.
EStructMode structMode() const
Get what structure mode the object was constructed with.
Members m_data
Member variables of the base class.
AthContainers_detail::lock_guard< mutex_t > guard_t
Guard type for multithreaded synchronisation.
virtual bool resize(std::size_t size) override
Resize the arrays to a given size.
virtual std::size_t size() const override
Return the number of elements in the store.
virtual const void * getInputObject(SG::auxid_t auxid) const =0
Get a pointer to an input object, as it is in memory, for getIOData()
virtual void selectAux(const std::set< std::string > &attributes)
Select dynamic auxiliary attributes for writing.
virtual void lock() override
Lock the object, and don't let decorations be added.
size_t auxid_t
Identifier for a particular aux data item.
Struct collecting all member variables of this base class.
SG::auxid_set_t m_auxIDs
Internal list of auxiliary variable IDs handled currently by the object.
EStructMode m_structMode
The "structural" mode of the object.
std::string m_prefix
Static prefix for the branch names.
std::string m_dynPrefix
Dynamic prefix for the branch names.
std::size_t m_size
The current size of the container being described.
std::unique_ptr< SG::AuxStoreInternal > m_transientStore
Store for the in-memory-only variables.
std::vector< bool > m_isDecoration
Per variable lock status (indexed by auxiliary ID)
SG::auxid_set_t m_decorIDs
Internal list of auxiliary decoration IDs handled currently by the object.
bool m_topStore
Flag stating whether this is a "top store".
std::vector< std::unique_ptr< SG::IAuxTypeVector > > m_vecs
Variables handled currently by the object (indexed by auxiliary ID)