ATLAS Offline Software
|
Base class for dynamic auxiliary stores saved into ByteStream. More...
#include <ByteStreamAuxContainer_v1.h>
Public Types | |
typedef SG::auxid_t | auxid_t |
The aux ID type definition from IConstAuxStore. More... | |
typedef SG::auxid_set_t | auxid_set_t |
The aux ID set type definition from IConstAuxStore. More... | |
template<class T , class ALLOC = std::allocator<T>> | |
using | AuxVariable_t = std::vector< T, ALLOC > |
Declare how to wrap variables for this sort of base. More... | |
Public Member Functions | |
ByteStreamAuxContainer_v1 () | |
Default constructor. More... | |
ByteStreamAuxContainer_v1 (const ByteStreamAuxContainer_v1 &parent) | |
Copy constructor. More... | |
virtual | ~ByteStreamAuxContainer_v1 () |
Destructor. More... | |
ByteStreamAuxContainer_v1 & | operator= (const ByteStreamAuxContainer_v1 &rhs) |
Assignment operator. More... | |
void | reset () |
Function resetting the internal (cached) state of the object. More... | |
template<typename T > | |
auxid_t | getAuxID (const std::string &name, std::vector< T > &, SG::AuxVarFlags flags=SG::AuxVarFlags::None) |
Get the auxiliary ID for one of the persistent variables. More... | |
template<typename T > | |
void | regAuxVar (auxid_t auxid, const std::string &name, std::vector< T > &vec) |
Register one of the user defined 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 bool | setOption (auxid_t, const AuxDataOption &) |
Set an option for a given auxiliary variable. More... | |
virtual IAuxTypeVector * | linkedVector (SG::auxid_t) |
virtual const IAuxTypeVector * | linkedVector (SG::auxid_t) const |
Return interface for a linked variable. 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 Member Functions | |
size_t | size_noLock () const |
Internal method: return size without taking out the lock. More... | |
template<typename T > | |
SG::IAuxTypeVector * | getVector1 (auxid_t auxid, std::map< std::string, std::vector< T > > &pers, size_t size, size_t capacity, bool quiet, bool forDecor) const |
Function retrieving a simple dynamic variable. More... | |
SG::IAuxTypeVector * | getVector1 (auxid_t auxid, size_t size, size_t capacity, bool quiet, bool forDecor) const |
Private Attributes | |
std::string | m_name |
Name of the container in memory. Set externally. More... | |
Transient variables used to implement the IAuxStore interface | |
typedef AthContainers_detail::mutex | mutex_t |
Mutex for multithread synchronization. More... | |
typedef AthContainers_detail::lock_guard< mutex_t > | guard_t |
auxid_set_t m_auxids | ATLAS_THREAD_SAFE |
Internal list of auxiliary variables. More... | |
std::vector< SG::IAuxTypeVector * > | m_staticVecs |
Internal list of static managed variables. More... | |
std::vector< SG::IAuxTypeVector * > m_dynamicVecs | ATLAS_THREAD_SAFE |
Internal list of dynamic managed variables. More... | |
bool | m_locked |
Has the container been locked? More... | |
SG::auxid_set_t | m_decorations |
Record which variables are decorations. More... | |
mutex_t | m_mutex |
Base class for dynamic auxiliary stores saved into ByteStream.
The point of this class is to behave similarly to xAOD::AuxContainerBase. The trigger developers can develop their specific auxiliary store classes on top of this class. The base class can manage the storage of simple variable types, while the classes inheriting from it need to manage any specific variables that they want to store.
Definition at line 39 of file ByteStreamAuxContainer_v1.h.
The aux ID set type definition from IConstAuxStore.
Definition at line 50 of file ByteStreamAuxContainer_v1.h.
The aux ID type definition from IConstAuxStore.
Definition at line 48 of file ByteStreamAuxContainer_v1.h.
using xAOD::ByteStreamAuxContainer_v1::AuxVariable_t = std::vector<T, ALLOC> |
Declare how to wrap variables for this sort of base.
Definition at line 136 of file ByteStreamAuxContainer_v1.h.
|
private |
Definition at line 195 of file ByteStreamAuxContainer_v1.h.
|
private |
Mutex for multithread synchronization.
Definition at line 194 of file ByteStreamAuxContainer_v1.h.
xAOD::ByteStreamAuxContainer_v1::ByteStreamAuxContainer_v1 | ( | ) |
xAOD::ByteStreamAuxContainer_v1::ByteStreamAuxContainer_v1 | ( | const ByteStreamAuxContainer_v1 & | parent | ) |
|
virtual |
|
overridevirtual |
Clear all decorations.
Implements SG::IConstAuxStore.
Definition at line 194 of file ByteStreamAuxContainer_v1.cxx.
auxid_t xAOD::ByteStreamAuxContainer_v1::getAuxID | ( | const std::string & | name, |
std::vector< T > & | , | ||
SG::AuxVarFlags | flags = SG::AuxVarFlags::None |
||
) |
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 117 of file ByteStreamAuxContainer_v1.cxx.
Get a pointer to a given array.
Implements SG::IConstAuxStore.
Definition at line 85 of file ByteStreamAuxContainer_v1.cxx.
|
overridevirtual |
Get a pointer to a given array, creating the array if necessary.
Implements SG::IAuxStore.
Definition at line 259 of file ByteStreamAuxContainer_v1.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.
Definition at line 131 of file ByteStreamAuxContainer_v1.cxx.
|
overridevirtual |
Get the types(names) of decorations handled by this container.
Implements SG::IConstAuxStore.
Definition at line 124 of file ByteStreamAuxContainer_v1.cxx.
|
finaloverridevirtual |
Return vector interface for one aux data item.
Implements SG::IConstAuxStore.
Definition at line 94 of file ByteStreamAuxContainer_v1.cxx.
|
private |
Definition at line 536 of file ByteStreamAuxContainer_v1.cxx.
|
private |
Function retrieving a simple dynamic variable.
Look for variable auxid in pers.
If capacity > 0, a new variable will be created if necessary.
If not found, create it if capacity != 0.
Definition at line 464 of file ByteStreamAuxContainer_v1.cxx.
|
overridevirtual |
Return a set of writable data identifiers.
Implements SG::IAuxStore.
Definition at line 290 of file ByteStreamAuxContainer_v1.cxx.
|
overridevirtual |
Insert contents of another store via move.
Definition at line 362 of file ByteStreamAuxContainer_v1.cxx.
|
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.
Definition at line 181 of file ByteStreamAuxContainer_v1.cxx.
|
inlinevirtualinherited |
Reimplemented in SG::AuxStoreInternal, xAOD::AuxContainerBase, xAOD::AuxInfoBase, and xAOD::TAuxStore.
Definition at line 187 of file IAuxStore.h.
|
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.
|
inlinevirtualinherited |
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.
Reimplemented in SG::AuxStoreInternal, xAOD::TAuxStore, xAOD::AuxContainerBase, and xAOD::AuxInfoBase.
Definition at line 189 of file IConstAuxStore.h.
|
overridevirtual |
|
overridevirtual |
Lock a decoration.
Implements SG::IConstAuxStore.
Definition at line 227 of file ByteStreamAuxContainer_v1.cxx.
Get the name of the container instance.
Definition at line 449 of file ByteStreamAuxContainer_v1.cxx.
ByteStreamAuxContainer_v1 & xAOD::ByteStreamAuxContainer_v1::operator= | ( | const ByteStreamAuxContainer_v1 & | rhs | ) |
void xAOD::ByteStreamAuxContainer_v1::regAuxVar | ( | auxid_t | auxid, |
const std::string & | name, | ||
std::vector< T > & | vec | ||
) |
Register one of the user defined persistent variables internally.
|
overridevirtual |
Reserve a given size for the arrays.
Implements SG::IAuxStore.
Definition at line 320 of file ByteStreamAuxContainer_v1.cxx.
void xAOD::ByteStreamAuxContainer_v1::reset | ( | ) |
Function resetting the internal (cached) state of the object.
Definition at line 427 of file ByteStreamAuxContainer_v1.cxx.
|
overridevirtual |
Resize the arrays to a given size.
Implements SG::IAuxStore.
Definition at line 295 of file ByteStreamAuxContainer_v1.cxx.
Set the name of the container instance.
Definition at line 454 of file ByteStreamAuxContainer_v1.cxx.
|
inlinevirtualinherited |
Set an option for a given auxiliary variable.
auxid | The identifier of the desired aux data item. |
option | The option to set. |
The interpretation of the option depends on the particular representation of the variable.
Returns true if the option setting was successful; false otherwise.
Reimplemented in xAOD::AuxContainerBase, xAOD::AuxInfoBase, and SG::AuxStoreInternal.
Definition at line 173 of file IAuxStore.h.
|
overridevirtual |
Shift the contents of the stored arrays.
Implements SG::IAuxStore.
Definition at line 341 of file ByteStreamAuxContainer_v1.cxx.
|
overridevirtual |
Get the size of the container.
Implements SG::IConstAuxStore.
Definition at line 252 of file ByteStreamAuxContainer_v1.cxx.
|
private |
Internal method: return size without taking out the lock.
Definition at line 234 of file ByteStreamAuxContainer_v1.cxx.
|
mutableprivate |
Variable holding integer auxiliary variables.
Definition at line 169 of file ByteStreamAuxContainer_v1.h.
|
mutableprivate |
Variable holding float auxiliary variables.
Definition at line 171 of file ByteStreamAuxContainer_v1.h.
|
mutableprivate |
Variable holding vector of integer auxiliary variables.
Definition at line 173 of file ByteStreamAuxContainer_v1.h.
|
mutableprivate |
Variable holding vector of float auxiliary variables.
Definition at line 175 of file ByteStreamAuxContainer_v1.h.
|
mutableprivate |
Internal list of auxiliary variables.
Definition at line 183 of file ByteStreamAuxContainer_v1.h.
|
mutableprivate |
Internal list of dynamic managed variables.
Definition at line 187 of file ByteStreamAuxContainer_v1.h.
|
private |
Record which variables are decorations.
Definition at line 191 of file ByteStreamAuxContainer_v1.h.
|
private |
Has the container been locked?
Definition at line 189 of file ByteStreamAuxContainer_v1.h.
|
mutableprivate |
Definition at line 196 of file ByteStreamAuxContainer_v1.h.
|
private |
Name of the container in memory. Set externally.
Definition at line 201 of file ByteStreamAuxContainer_v1.h.
|
private |
Internal list of static managed variables.
Definition at line 185 of file ByteStreamAuxContainer_v1.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.