ATLAS Offline Software
|
IConstAuxStore implementation referencing external buffers. More...
#include <AuxStoreConstMem.h>
Public Member Functions | |
AuxStoreConstMem (size_t size) | |
Constructor. More... | |
void | addBuffer (SG::auxid_t auxid, const void *buf) |
Add a new, external buffer. More... | |
virtual const void * | getData (SG::auxid_t auxid) const override |
Return the data vector for one aux data item. More... | |
virtual const IAuxTypeVector * | getVector (SG::auxid_t) const override |
Return vector interface for one aux data item. More... | |
virtual void * | getDecoration (auxid_t auxid, size_t size, size_t capacity) override |
Return the data vector for one aux data decoration item. More... | |
virtual const SG::auxid_set_t & | getAuxIDs () const override |
Return a set of identifiers for existing data items in this store. More... | |
virtual const SG::auxid_set_t & | getDecorIDs () const override |
Return a set of identifiers for decorations in this store. More... | |
virtual bool | isDecoration (auxid_t auxid) const override |
Test if a particular variable is tagged as a decoration. More... | |
virtual void | lock () override |
Lock the container. More... | |
virtual bool | clearDecorations () override |
Clear all decorations. More... | |
virtual size_t | size () const override |
Return the number of elements in the store. More... | |
virtual void | lockDecoration (SG::auxid_t auxid) override |
Lock a decoration. More... | |
virtual const IAuxTypeVector * | linkedVector (SG::auxid_t) const |
Return interface for a linked variable. More... | |
Private Attributes | |
size_t | m_size |
std::vector< const void * > | m_buffers |
SG::auxid_set_t | m_auxids |
Set of auxid's for which we've added a buffer. More... | |
IConstAuxStore implementation referencing external buffers.
This is an implementation of IConstAuxStore
that, rather than managing memory itself, simply holds references to buffers managed externally.
You need to specify the number of elements when you create the object. Then call addBuffer
for each auxiliary variable to be managed, passing the auxid and the buffer.
This class assumes the managed data is strictly const, and hence makes no attempt to implement decorations.
Definition at line 36 of file AuxStoreConstMem.h.
SG::AuxStoreConstMem::AuxStoreConstMem | ( | size_t | size | ) |
Constructor.
size | The number of elements in the container. |
Definition at line 23 of file AuxStoreConstMem.cxx.
void SG::AuxStoreConstMem::addBuffer | ( | SG::auxid_t | auxid, |
const void * | buf | ||
) |
Add a new, external buffer.
auxid | The identifier of the aux data item. |
buf | Pointer to the start of the buffer for the variable. |
The actual type of the data pointed to must match the registered type of auxid
; no checking is done.
This method is not compatible with any other accesses to this object in other threads.
Definition at line 40 of file AuxStoreConstMem.cxx.
|
overridevirtual |
Clear all decorations.
This is a no-op for this (const) class. Always returns false.
Implements SG::IConstAuxStore.
Definition at line 148 of file AuxStoreConstMem.cxx.
|
overridevirtual |
Return a set of identifiers for existing data items in this store.
This should include identifiers for all items, const and non-const.
Implements SG::IConstAuxStore.
Definition at line 103 of file AuxStoreConstMem.cxx.
|
overridevirtual |
Return the data vector for one aux data item.
auxid | The identifier of the desired aux data item. |
Each aux data item is stored as a vector, with one entry per entry in the owning container. This returns a pointer to the start of the vector.
This should return 0 if the item doesn't exist.
Implements SG::IConstAuxStore.
Definition at line 59 of file AuxStoreConstMem.cxx.
|
overridevirtual |
Return the data vector for one aux data decoration item.
auxid | The identifier of the desired aux data item. |
size | The current size of the container (in case the data item does not already exist). |
capacity | The current capacity of the container (in case the data item does not already exist). |
This always returns null for this (const) class.
Implements SG::IConstAuxStore.
Definition at line 90 of file AuxStoreConstMem.cxx.
|
overridevirtual |
Return a set of identifiers for decorations in this store.
Implements SG::IConstAuxStore.
Definition at line 112 of file AuxStoreConstMem.cxx.
|
overridevirtual |
Return vector interface for one aux data item.
auxid | The identifier of the desired aux data item. |
Unimplmented for this implementation.
Implements SG::IConstAuxStore.
Definition at line 74 of file AuxStoreConstMem.cxx.
|
overridevirtual |
Test if a particular variable is tagged as a decoration.
auxid | The identifier of the desired aux data item. |
This always returns false for this (const) class.
Implements SG::IConstAuxStore.
Definition at line 125 of file AuxStoreConstMem.cxx.
|
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 |
Lock the container.
After this, only decorations can be changed/modified.
This is a no-op for this (const) class.
Implements SG::IConstAuxStore.
Definition at line 138 of file AuxStoreConstMem.cxx.
|
overridevirtual |
Lock a decoration.
auxid | Identifier of the decoration to lock. |
This is a no-op for this (const) class.
Implements SG::IConstAuxStore.
Definition at line 171 of file AuxStoreConstMem.cxx.
|
overridevirtual |
Return the number of elements in the store.
May return 0 for a store with no aux data.
Implements SG::IConstAuxStore.
Definition at line 159 of file AuxStoreConstMem.cxx.
|
private |
Set of auxid's
for which we've added a buffer.
Definition at line 161 of file AuxStoreConstMem.h.
|
private |
Definition at line 158 of file AuxStoreConstMem.h.
|
private |
Definition at line 157 of file AuxStoreConstMem.h.