ATLAS Offline Software
|
Common base class for auxiliary info objects. More...
#include <AuxInfoBase.h>
Inherits SG::IAuxStore, SG::IAuxStoreIO, SG::IAuxStoreHolder, and ILockable.
Inherited by DMTest::CInfoAuxContainer_v1, DMTest::CLinksAuxInfo_v1, DMTest::JVecAuxInfo_v1, DMTest::PLinksAuxInfo_v1, xAOD::CMMRoIAuxInfo_v1, xAOD::EnergySumRoIAuxInfo_v1, xAOD::EnergySumRoIAuxInfo_v2, xAOD::EventAuxInfo_v1, xAOD::EventAuxInfo_v2, xAOD::EventAuxInfo_v3, xAOD::EventShapeAuxInfo_v1, xAOD::FileMetaDataAuxInfo_v1, xAOD::JetEtRoIAuxInfo_v1, xAOD::RoiDescriptorStoreAuxInfo_v1, xAOD::TrigDecisionAuxInfo_v1, and xAOD::TrigNavigationAuxInfo_v1.
Public Types | |
typedef SG::auxid_t | auxid_t |
The aux ID type definition. More... | |
typedef SG::auxid_set_t | auxid_set_t |
The aux ID set type definition. More... | |
template<class T , class ALLOC = std::allocator<T>> | |
using | AuxVariable_t = T |
Declare how to wrap variables for this sort of base. More... | |
template<class T , class ALLOC = std::allocator<T>> | |
using | LinkedVariable_t = std::vector< T, ALLOC > |
enum | AuxStoreType { AST_ObjectStore = 0, AST_ContainerStore = 1 } |
Type of the auxiliary store. More... | |
Public Member Functions | |
AuxInfoBase (bool allowDynamicVars=true) | |
Default constructor. More... | |
AuxInfoBase (const AuxInfoBase &parent) | |
Copy constructor. More... | |
AuxInfoBase (SG::IAuxStore *store) | |
Constructor receiving a "dynamic auxiliary store". More... | |
~AuxInfoBase () | |
Destructor. More... | |
AuxInfoBase & | operator= (const AuxInfoBase &rhs) |
Assignment operator. More... | |
template<typename T > | |
auxid_t | getAuxID (const std::string &name, T &, SG::AuxVarFlags flags=SG::AuxVarFlags::None, const SG::auxid_t linkedVariable=SG::null_auxid) |
Get the auxiliary ID for one of the persistent variables. More... | |
template<typename T > | |
void | regAuxVar (auxid_t auxid, const std::string &name, T &info) |
Register one of the persistent variables internally. More... | |
virtual const void * | getData (SG::auxid_t auxid) const=0 |
Pick up the const version from the base class. More... | |
virtual bool | insertMove (size_t pos, IAuxStore &other, const SG::auxid_set_t &ignore=SG::auxid_set_t())=0 |
Move all elements from other to this store. More... | |
virtual const IAuxTypeVector * | linkedVector (SG::auxid_t) const |
Return interface for a linked variable. More... | |
Static Public Attributes | |
static constexpr bool | supportsThinning = true |
Mark that this type supports thinning operations. More... | |
Private Types | |
typedef AthContainers_detail::mutex | mutex_t |
Mutex for multithread synchronization. More... | |
typedef AthContainers_detail::lock_guard< mutex_t > | guard_t |
Private Attributes | |
auxid_set_t | m_auxids |
Internal list of all available variables. More... | |
std::vector< SG::IAuxTypeVector * > | m_vecs |
Internal list of all managed variables. More... | |
SG::IAuxStore * | m_store |
Internal dynamic auxiliary store object. More... | |
SG::IAuxStoreIO * | m_storeIO |
The IO interface to the internal auxiliary store. More... | |
bool | m_ownsStore |
Flag deciding if the object owns the dynamic store or not. More... | |
bool | m_locked |
Has the container been locked? More... | |
mutex_t | m_mutex |
std::string | m_name |
Name of the container in memory. Set externally. More... | |
Common base class for auxiliary info objects.
This class should be used as the base for classes describing auxiliary information about standalone objects. The most important example of this is the xAOD::EventInfo object...
Definition at line 43 of file AuxInfoBase.h.
The aux ID set type definition.
Definition at line 55 of file AuxInfoBase.h.
The aux ID type definition.
Definition at line 53 of file AuxInfoBase.h.
using xAOD::AuxInfoBase::AuxVariable_t = T |
Declare how to wrap variables for this sort of base.
Definition at line 179 of file AuxInfoBase.h.
|
private |
Definition at line 212 of file AuxInfoBase.h.
using xAOD::AuxInfoBase::LinkedVariable_t = std::vector<T, ALLOC> |
Definition at line 181 of file AuxInfoBase.h.
|
private |
Mutex for multithread synchronization.
Definition at line 211 of file AuxInfoBase.h.
|
inherited |
Type of the auxiliary store.
In the xAOD EDM we use auxiliary store objects in some cases to describe a single object, and in most cases to describe a container of objects. This enumeration declares which type the object implementing this interface is.
Enumerator | |
---|---|
AST_ObjectStore | The store describes a single object. |
AST_ContainerStore | The store describes a container. |
Definition at line 66 of file IAuxStoreHolder.h.
xAOD::AuxInfoBase::AuxInfoBase | ( | bool | allowDynamicVars = true | ) |
xAOD::AuxInfoBase::AuxInfoBase | ( | const AuxInfoBase & | parent | ) |
Copy constructor.
This is an interesting one.
The internal variables of AuxInfoBase are set up by the derived class(es) at construction. So, this internal state is not to be copied!
However, since the derived classes (the contents of their regular members) are allowed to be copied, let's not make this constructor private.
Definition at line 46 of file AuxInfoBase.cxx.
xAOD::AuxInfoBase::AuxInfoBase | ( | SG::IAuxStore * | store | ) |
Constructor receiving a "dynamic auxiliary store".
This constructor is used to wrap another object that is stored in StoreGate, and hence we should not take ownership of.
store | Another store that should be wrapped, but not owned |
Definition at line 72 of file AuxInfoBase.cxx.
xAOD::AuxInfoBase::~AuxInfoBase | ( | ) |
|
overridevirtual |
Clear all decorations.
Implements SG::IConstAuxStore.
Definition at line 322 of file AuxInfoBase.cxx.
auxid_t xAOD::AuxInfoBase::getAuxID | ( | const std::string & | name, |
T & | , | ||
SG::AuxVarFlags | flags = SG::AuxVarFlags::None , |
||
const SG::auxid_t | linkedVariable = SG::null_auxid |
||
) |
Get the auxiliary ID for one of the persistent variables.
|
overridevirtual |
Get the types(names) of variables handled by this container.
Implements SG::IConstAuxStore.
Definition at line 249 of file AuxInfoBase.cxx.
Get a pointer to a given array.
Implements SG::IConstAuxStore.
Definition at line 195 of file AuxInfoBase.cxx.
|
overridevirtual |
Get a pointer to a given array, creating the array if necessary.
Implements SG::IAuxStore.
Definition at line 424 of file AuxInfoBase.cxx.
|
inherited |
Pick up the const version from the base class.
|
overridevirtual |
Get a pointer to a given array, as a decoration.
Implements SG::IConstAuxStore.
Reimplemented in xAOD::EventAuxInfo_v1, xAOD::EventAuxInfo_v2, and xAOD::EventAuxInfo_v3.
Definition at line 265 of file AuxInfoBase.cxx.
|
overridevirtual |
Get the types(names) of decorations handled by this container.
Implements SG::IConstAuxStore.
Definition at line 256 of file AuxInfoBase.cxx.
|
overridevirtual |
Get the types(names) of variables created dynamically.
Implements SG::IAuxStoreIO.
Definition at line 636 of file AuxInfoBase.cxx.
Get a pointer to the data being stored for one aux data item.
Implements SG::IAuxStoreIO.
Definition at line 585 of file AuxInfoBase.cxx.
Return the type of the data to be stored for one aux data item.
Implements SG::IAuxStoreIO.
Definition at line 612 of file AuxInfoBase.cxx.
|
overridevirtual |
Get the IDs of the selected dynamic Aux variables (for writing)
Reimplemented from SG::IAuxStoreIO.
Definition at line 657 of file AuxInfoBase.cxx.
|
overridevirtual |
Get the currently used internal store object.
Implements SG::IAuxStoreHolder.
Definition at line 146 of file AuxInfoBase.cxx.
|
overridevirtual |
Get the currently used internal store object.
Implements SG::IAuxStoreHolder.
Definition at line 140 of file AuxInfoBase.cxx.
|
inlineoverridevirtual |
Return the type of the store object.
Implements SG::IAuxStoreHolder.
Definition at line 79 of file AuxInfoBase.h.
|
finaloverridevirtual |
Return vector interface for one aux data item.
Implements SG::IConstAuxStore.
Definition at line 204 of file AuxInfoBase.cxx.
|
overridevirtual |
Return a set of writable data identifiers.
Implements SG::IAuxStore.
Definition at line 460 of file AuxInfoBase.cxx.
|
overridevirtual |
|
pure virtualinherited |
Move all elements from other
to this store.
pos | The starting index of the insertion. |
other | Store from which to do the move. |
ignore | Set of variables that should not be added to the store. |
Let len
be the size of other
. The store will be increased in size by len
elements, with the elements at pos
being copied to pos+len
. Then, for each auxiliary variable, the entire contents of that variable for other
will be moved to this store at index pos
. This will be done via move semantics if possible; otherwise, it will be done with a copy. Variables present in this store but not in other
will have the corresponding elements default-initialized. Variables in other
but not in this store will be added unless they are in ignore
.
Returns true if it is known that none of the vectors' memory moved, false otherwise.
Implemented in SG::AuxStoreInternal.
Test if a variable is a decoration.
Implements SG::IConstAuxStore.
Reimplemented in xAOD::EventAuxInfo_v1, xAOD::EventAuxInfo_v2, and xAOD::EventAuxInfo_v3.
Definition at line 239 of file AuxInfoBase.cxx.
|
overridevirtual |
Return interface for a linked variable.
Reimplemented from SG::IConstAuxStore.
Definition at line 359 of file AuxInfoBase.cxx.
|
overridevirtual |
Return interface for a linked variable.
Reimplemented from SG::IAuxStore.
Definition at line 376 of file AuxInfoBase.cxx.
|
inlineinherited |
Return interface for a linked variable.
auxid | The ID of the parent variable. |
If auxid
has a linked variable, then return the IAuxTypeVector
describing it. Otherwise, return nullptr
. May return nullptr
unconditionally if this store does not support linked variables.
Definition at line 189 of file IConstAuxStore.h.
|
overridevirtual |
|
overridevirtual |
Lock a decoration.
Implements SG::IConstAuxStore.
Reimplemented in xAOD::EventAuxInfo_v1, xAOD::EventAuxInfo_v2, and xAOD::EventAuxInfo_v3.
Definition at line 351 of file AuxInfoBase.cxx.
Get the name of the container instance.
Definition at line 679 of file AuxInfoBase.cxx.
AuxInfoBase & xAOD::AuxInfoBase::operator= | ( | const AuxInfoBase & | rhs | ) |
Assignment operator.
Just like the copy constructor, this operator doesn't actually copy anything either.
It's just here to make it clear to C++ that the internal state of these objects is not to be messed with.
Definition at line 105 of file AuxInfoBase.cxx.
void xAOD::AuxInfoBase::regAuxVar | ( | auxid_t | auxid, |
const std::string & | name, | ||
T & | info | ||
) |
Register one of the persistent variables internally.
|
overridevirtual |
Reserve a given size for the arrays.
Implements SG::IAuxStore.
Definition at line 501 of file AuxInfoBase.cxx.
|
overridevirtual |
Resize the arrays to a given size.
Implements SG::IAuxStore.
Definition at line 467 of file AuxInfoBase.cxx.
Set the name of the container instance.
Definition at line 684 of file AuxInfoBase.cxx.
|
overridevirtual |
Make an option setting on an aux variable.
Reimplemented from SG::IAuxStore.
Definition at line 567 of file AuxInfoBase.cxx.
|
overridevirtual |
Set a different internal store object.
This function is used by the I/O infrastructure to possibly put a store object into this one, which can interact with dynamic variables directly.
Note that the object takes ownership of the received store.
store | The store that should be used for dynamic variable handling inside the object from now on |
Implements SG::IAuxStoreHolder.
Definition at line 160 of file AuxInfoBase.cxx.
|
overridevirtual |
Shift the contents of the stored arrays.
Implements SG::IAuxStore.
Definition at line 532 of file AuxInfoBase.cxx.
|
overridevirtual |
Get the size of the container.
Implements SG::IConstAuxStore.
Definition at line 393 of file AuxInfoBase.cxx.
|
private |
Internal list of all available variables.
Definition at line 197 of file AuxInfoBase.h.
|
private |
Has the container been locked?
Definition at line 208 of file AuxInfoBase.h.
|
mutableprivate |
Definition at line 213 of file AuxInfoBase.h.
|
private |
Name of the container in memory. Set externally.
Definition at line 216 of file AuxInfoBase.h.
|
private |
Flag deciding if the object owns the dynamic store or not.
Definition at line 206 of file AuxInfoBase.h.
|
private |
Internal dynamic auxiliary store object.
Definition at line 202 of file AuxInfoBase.h.
|
private |
The IO interface to the internal auxiliary store.
Definition at line 204 of file AuxInfoBase.h.
|
private |
Internal list of all managed variables.
Definition at line 199 of file AuxInfoBase.h.
|
staticconstexprinherited |
Mark that this type supports thinning operations.
See AthContainers/supportsThinning.h and AthenaPoolCnvSvc/T_AthenaPoolCnv.h. Helps guide which pool converter template will be used. If false, the default pool converter will be used rather than the aux store-specific one. Ordinary xAOD type should not touch this, but may be overridden in a derived class to handle certain special cases.
Definition at line 199 of file IAuxStore.h.