ATLAS Offline Software
|
Class creating a shallow copy of an existing auxiliary container. More...
#include <ShallowAuxContainer.h>
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... | |
enum | AuxStoreType { AST_ObjectStore = 0, AST_ContainerStore = 1 } |
Type of the auxiliary store. More... | |
Public Member Functions | |
ShallowAuxContainer (bool standalone=false) | |
Default constructor. More... | |
ShallowAuxContainer (const ShallowAuxContainer &parent) | |
Copy constructor. More... | |
ShallowAuxContainer (const DataLink< SG::IConstAuxStore > &parent, bool standalone=false) | |
Constructor with a parent object. More... | |
~ShallowAuxContainer () | |
Destructor. More... | |
ShallowAuxContainer & | operator= (const ShallowAuxContainer &rhs) |
Assignment operator. More... | |
const DataLink< SG::IConstAuxStore > & | parent () const |
Get the parent store. More... | |
void | setParent (const DataLink< SG::IConstAuxStore > &link) |
Set the parent store. More... | |
bool | shallowIO () const |
Check whether only the overriden parameters will be written out or not. More... | |
void | setShallowIO (bool value) |
Set whether only the overriden parameters should be written out. 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 Types | |
typedef AthContainers_detail::recursive_mutex | mutex_t |
Mutex for multithread synchronization. More... | |
typedef AthContainers_detail::lock_guard< mutex_t > | guard_t |
Private Member Functions | |
void | remakeAuxIDs () const |
Private Attributes | |
AuxSelection | m_selection |
Dynamic attributes selection implementation. 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 |
Flag keeping track of whether this object is locked or not. More... | |
DataLink< SG::IConstAuxStore > | m_parentLink |
Link to the parent object. More... | |
const SG::IAuxStoreIO * | m_parentIO |
Optional pointer to the IO interface of the parent object. More... | |
bool | m_shallowIO |
Flag for whether to do "shallow IO" or not. More... | |
mutex_t | m_mutex |
auxid_set_t m_auxids | ATLAS_THREAD_SAFE |
auxid_set_t m_decorids | ATLAS_THREAD_SAFE |
bool m_auxidsValid | ATLAS_THREAD_SAFE |
std::string | m_name |
Name of the container in memory. Set externally. More... | |
Functions implementing the SG::IAuxStoreHolder interface | |
virtual SG::IAuxStore * | getStore () override |
Get the currently used internal store object. More... | |
virtual const SG::IAuxStore * | getStore () const override |
virtual void | setStore (SG::IAuxStore *store) override |
Set a different internal store object. More... | |
virtual AuxStoreType | getStoreType () const override |
Return the type of the store object. More... | |
Class creating a shallow copy of an existing auxiliary container.
During analysis, in order to create objects that override just some of the properties of an original, it's wasteful to make full copies of the objects. Not to mention that the full copies have generally issues with dynamic variables.
The behaviour of this class is that it takes all the properties that it doesn't know about from the parent auxiliary store, but the ones that it has an override for, it provides itself.
The object is persistifiable. The user can choose whether to only write out the variables that were modified wrt. the original container, or possibly all the variables. (In case the original container is not getting written out.)
Definition at line 48 of file ShallowAuxContainer.h.
The aux ID set type definition.
Definition at line 60 of file ShallowAuxContainer.h.
The aux ID type definition.
Definition at line 58 of file ShallowAuxContainer.h.
|
private |
Definition at line 202 of file ShallowAuxContainer.h.
|
private |
Mutex for multithread synchronization.
Definition at line 201 of file ShallowAuxContainer.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::ShallowAuxContainer::ShallowAuxContainer | ( | bool | standalone = false | ) |
Default constructor.
standalone | true if the store will be used for a standalone object, false for a container |
Definition at line 31 of file ShallowAuxContainer.cxx.
xAOD::ShallowAuxContainer::ShallowAuxContainer | ( | const ShallowAuxContainer & | parent | ) |
xAOD::ShallowAuxContainer::ShallowAuxContainer | ( | const DataLink< SG::IConstAuxStore > & | parent, |
bool | standalone = false |
||
) |
Constructor with a parent object.
parent | The parent object to make a shallow copy of |
standalone | true if the store will be used for a standalone object, false for a container |
Definition at line 62 of file ShallowAuxContainer.cxx.
xAOD::ShallowAuxContainer::~ShallowAuxContainer | ( | ) |
Destructor.
Definition at line 77 of file ShallowAuxContainer.cxx.
|
overridevirtual |
Clear all decorations.
Implements SG::IConstAuxStore.
Definition at line 374 of file ShallowAuxContainer.cxx.
|
overridevirtual |
Get the types(names) of variables handled by this container.
Implements SG::IConstAuxStore.
Definition at line 227 of file ShallowAuxContainer.cxx.
Get a pointer to a given array.
Implements SG::IConstAuxStore.
Definition at line 187 of file ShallowAuxContainer.cxx.
|
overridevirtual |
Get a pointer to a given array, creating the array if necessary.
Implements SG::IAuxStore.
Definition at line 393 of file ShallowAuxContainer.cxx.
|
inherited |
Pick up the const version from the base class.
|
overridevirtual |
Return the data vector for one aux data decoration item.
Implements SG::IConstAuxStore.
Definition at line 258 of file ShallowAuxContainer.cxx.
|
overridevirtual |
Get the types(names) of decorations handled by this container.
Implements SG::IConstAuxStore.
Definition at line 237 of file ShallowAuxContainer.cxx.
|
overridevirtual |
Get the types(names) of variables created dynamically.
Implements SG::IAuxStoreIO.
Definition at line 563 of file ShallowAuxContainer.cxx.
Get a pointer to the data being stored for one aux data item.
Implements SG::IAuxStoreIO.
Definition at line 510 of file ShallowAuxContainer.cxx.
Return the type of the data to be stored for one aux data item.
Implements SG::IAuxStoreIO.
Definition at line 536 of file ShallowAuxContainer.cxx.
|
overridevirtual |
Get the IDs of the selected dynamic Aux variables (for writing)
Reimplemented from SG::IAuxStoreIO.
Definition at line 578 of file ShallowAuxContainer.cxx.
|
overridevirtual |
Implements SG::IAuxStoreHolder.
Definition at line 154 of file ShallowAuxContainer.cxx.
|
overridevirtual |
Get the currently used internal store object.
Implements SG::IAuxStoreHolder.
Definition at line 149 of file ShallowAuxContainer.cxx.
|
inlineoverridevirtual |
Return the type of the store object.
Implements SG::IAuxStoreHolder.
Reimplemented in xAOD::ShallowAuxInfo.
Definition at line 94 of file ShallowAuxContainer.h.
|
finaloverridevirtual |
Return vector interface for one aux data item.
Implements SG::IConstAuxStore.
Definition at line 196 of file ShallowAuxContainer.cxx.
|
overridevirtual |
Return a set of writable data identifiers.
Implements SG::IAuxStore.
Definition at line 462 of file ShallowAuxContainer.cxx.
|
overridevirtual |
Insert contents of another store via move.
Definition at line 493 of file ShallowAuxContainer.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 246 of file ShallowAuxContainer.cxx.
|
inlinevirtualinherited |
Reimplemented in SG::AuxStoreInternal, xAOD::AuxContainerBase, xAOD::AuxInfoBase, xAOD::TAuxStore, and xAOD::RAuxStore.
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, xAOD::AuxInfoBase, and xAOD::RAuxStore.
Definition at line 189 of file IConstAuxStore.h.
|
overridevirtual |
|
overridevirtual |
Lock a decoration.
Implements SG::IConstAuxStore.
Definition at line 353 of file ShallowAuxContainer.cxx.
Get the name of the container instance.
Definition at line 595 of file ShallowAuxContainer.cxx.
ShallowAuxContainer & xAOD::ShallowAuxContainer::operator= | ( | const ShallowAuxContainer & | rhs | ) |
const DataLink< SG::IConstAuxStore > & xAOD::ShallowAuxContainer::parent | ( | ) | const |
Get the parent store.
Definition at line 117 of file ShallowAuxContainer.cxx.
|
private |
Definition at line 606 of file ShallowAuxContainer.cxx.
|
overridevirtual |
Reserve a given size for the arrays.
Implements SG::IAuxStore.
Definition at line 479 of file ShallowAuxContainer.cxx.
|
overridevirtual |
Resize the arrays to a given size.
Implements SG::IAuxStore.
Definition at line 469 of file ShallowAuxContainer.cxx.
Set the name of the container instance.
Definition at line 600 of file ShallowAuxContainer.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.
void xAOD::ShallowAuxContainer::setParent | ( | const DataLink< SG::IConstAuxStore > & | link | ) |
void xAOD::ShallowAuxContainer::setShallowIO | ( | bool | value | ) |
Set whether only the overriden parameters should be written out.
Definition at line 137 of file ShallowAuxContainer.cxx.
|
overridevirtual |
Set a different internal store object.
Implements SG::IAuxStoreHolder.
Definition at line 159 of file ShallowAuxContainer.cxx.
bool xAOD::ShallowAuxContainer::shallowIO | ( | ) | const |
Check whether only the overriden parameters will be written out or not.
Definition at line 132 of file ShallowAuxContainer.cxx.
|
overridevirtual |
Shift the contents of the stored arrays.
Implements SG::IAuxStore.
Definition at line 486 of file ShallowAuxContainer.cxx.
|
overridevirtual |
Get the size of the container.
Implements SG::IConstAuxStore.
Definition at line 360 of file ShallowAuxContainer.cxx.
|
mutableprivate |
Definition at line 207 of file ShallowAuxContainer.h.
|
mutableprivate |
Definition at line 208 of file ShallowAuxContainer.h.
|
mutableprivate |
Definition at line 209 of file ShallowAuxContainer.h.
|
private |
Flag keeping track of whether this object is locked or not.
Definition at line 191 of file ShallowAuxContainer.h.
|
mutableprivate |
Definition at line 203 of file ShallowAuxContainer.h.
|
private |
Name of the container in memory. Set externally.
Definition at line 212 of file ShallowAuxContainer.h.
|
private |
Flag deciding if the object owns the dynamic store or not.
Definition at line 189 of file ShallowAuxContainer.h.
|
private |
Optional pointer to the IO interface of the parent object.
Definition at line 196 of file ShallowAuxContainer.h.
|
private |
Link to the parent object.
Definition at line 194 of file ShallowAuxContainer.h.
|
private |
Dynamic attributes selection implementation.
Definition at line 182 of file ShallowAuxContainer.h.
|
private |
Flag for whether to do "shallow IO" or not.
Definition at line 198 of file ShallowAuxContainer.h.
|
private |
Internal dynamic auxiliary store object.
Definition at line 185 of file ShallowAuxContainer.h.
|
private |
The IO interface to the internal auxiliary store.
Definition at line 187 of file ShallowAuxContainer.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.