ATLAS Offline Software
Public Member Functions | Static Public Attributes | List of all members
SG::IAuxStore Class Referenceabstract

Interface for non-const operations on an auxiliary store. More...

#include <IAuxStore.h>

Inheritance diagram for SG::IAuxStore:
Collaboration diagram for SG::IAuxStore:

Public Member Functions

virtual void * getData (auxid_t auxid, size_t size, size_t capacity)=0
 Return the data vector for one aux data item. More...
 
virtual const SG::auxid_set_tgetWritableAuxIDs () const =0
 Return a set of identifiers for writable data items in this store. More...
 
virtual bool resize (size_t sz)=0
 Change the size of all aux data vectors. More...
 
virtual void reserve (size_t sz)=0
 Change the capacity of all aux data vectors. More...
 
virtual void shift (size_t pos, ptrdiff_t offs)=0
 Shift the elements of the container. 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 IAuxTypeVectorlinkedVector (SG::auxid_t)
 
virtual const void * getData (SG::auxid_t auxid) const=0
 Pick up the const version from the base class. More...
 
virtual const IAuxTypeVectorlinkedVector (SG::auxid_t) const
 Return interface for a linked variable. More...
 
virtual const void * getData (SG::auxid_t auxid) const =0
 Return the data vector for one aux data item. More...
 
virtual void * getDecoration (auxid_t auxid, size_t size, size_t capacity)=0
 Return the data vector for one aux data decoration item. More...
 
virtual const SG::auxid_set_tgetAuxIDs () const =0
 Return a set of identifiers for existing data items in this store. More...
 
virtual bool isDecoration (auxid_t auxid) const =0
 Test if a particular variable is tagged as a decoration. More...
 
virtual void lock ()=0
 Lock the container. More...
 
virtual bool clearDecorations ()=0
 Clear all decorations. More...
 
virtual size_t size () const =0
 Return the number of elements in the store. More...
 
virtual void lockDecoration (SG::auxid_t auxid)=0
 Lock a decoration. More...
 
virtual const IAuxTypeVectorlinkedVector (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...
 

Detailed Description

Interface for non-const operations on an auxiliary store.

Definition at line 46 of file IAuxStore.h.

Member Function Documentation

◆ clearDecorations()

virtual bool SG::IConstAuxStore::clearDecorations ( )
pure virtualinherited

Clear all decorations.

Erase all decorations from the store, restoring the state to when lock was called. Be sure to clear the cache of the referencing container!

Returns true if there were any decorations that were cleared, false if the store did not contain any decorations.

Implemented in SG::AuxStoreInternal, xAOD::TAuxStore, SG::AuxStoreConstMem, xAOD::AuxContainerBase, xAOD::ShallowAuxContainer, xAOD::AuxInfoBase, and xAOD::ByteStreamAuxContainer_v1.

◆ getAuxIDs()

virtual const SG::auxid_set_t& SG::IConstAuxStore::getAuxIDs ( ) const
pure virtualinherited

Return a set of identifiers for existing data items in this store.

This should include identifiers for all items, const and non-const.

Implemented in SG::AuxStoreInternal, xAOD::TAuxStore, xAOD::AuxContainerBase, xAOD::ShallowAuxContainer, SG::AuxStoreConstMem, xAOD::AuxInfoBase, and xAOD::ByteStreamAuxContainer_v1.

◆ getData() [1/3]

virtual void* SG::IAuxStore::getData ( auxid_t  auxid,
size_t  size,
size_t  capacity 
)
pure virtual

Return the data vector for one aux data item.

Parameters
auxidThe identifier of the desired aux data item.
sizeThe current size of the container (in case the data item does not already exist).
capacityThe current capacity of the container (in case the data item does not already exist).

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.

If the data item does not exist, it should be created and initialized to default values. size and capacity give the size for the new aux data item vector.

If the container is locked, throw an exception.

Implemented in SG::AuxStoreInternal, APRTest::AuxStore, RootAuxDynStore, xAOD::TAuxStore, xAOD::AuxContainerBase, xAOD::ShallowAuxContainer, xAOD::AuxInfoBase, and xAOD::ByteStreamAuxContainer_v1.

◆ getData() [2/3]

virtual const void* SG::IConstAuxStore::getData ( SG::auxid_t  auxid) const
pure virtualinherited

Return the data vector for one aux data item.

Parameters
auxidThe 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.

Implemented in SG::AuxStoreInternal, SG::AuxStoreConstMem, APRTest::AuxStore, RootAuxDynStore, xAOD::TAuxStore, xAOD::AuxContainerBase, xAOD::ShallowAuxContainer, xAOD::AuxInfoBase, and xAOD::ByteStreamAuxContainer_v1.

◆ getData() [3/3]

virtual const void* SG::IConstAuxStore::getData

Pick up the const version from the base class.

◆ getDecoration()

virtual void* SG::IConstAuxStore::getDecoration ( auxid_t  auxid,
size_t  size,
size_t  capacity 
)
pure virtualinherited

Return the data vector for one aux data decoration item.

Parameters
auxidThe identifier of the desired aux data item.
sizeThe current size of the container (in case the data item does not already exist).
capacityThe current capacity of the container (in case the data item does not already exist).

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.

If the data item does not exist, it then it will be created and initialized with default values. If the container is locked, then the new item will be marked as a decoration. size and capacity give the size for the new aux data item vector.

If the data item already exists, then we return it if either the container is not locked or the item is marked as a decoration. Otherwise we throw an exception.

Implemented in xAOD::EventAuxInfo_v1, xAOD::EventInfoAuxContainer_v1, xAOD::EventAuxInfo_v2, xAOD::EventAuxInfo_v3, RootAuxDynStore, SG::AuxStoreInternal, xAOD::TAuxStore, xAOD::AuxContainerBase, xAOD::ShallowAuxContainer, xAOD::AuxInfoBase, SG::AuxStoreConstMem, and xAOD::ByteStreamAuxContainer_v1.

◆ getWritableAuxIDs()

virtual const SG::auxid_set_t& SG::IAuxStore::getWritableAuxIDs ( ) const
pure virtual

Return a set of identifiers for writable data items in this store.

This should include only non-const identifiers.

Implemented in SG::AuxStoreInternal, xAOD::TAuxStore, xAOD::AuxContainerBase, xAOD::ShallowAuxContainer, xAOD::AuxInfoBase, and xAOD::ByteStreamAuxContainer_v1.

◆ insertMove()

virtual bool SG::IAuxStore::insertMove ( size_t  pos,
IAuxStore other,
const SG::auxid_set_t ignore = SG::auxid_set_t() 
)
pure virtual

Move all elements from other to this store.

Parameters
posThe starting index of the insertion.
otherStore from which to do the move.
ignoreSet 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.

◆ isDecoration()

virtual bool SG::IConstAuxStore::isDecoration ( auxid_t  auxid) const
pure virtualinherited

◆ linkedVector() [1/3]

virtual IAuxTypeVector* SG::IAuxStore::linkedVector ( SG::auxid_t  )
inlinevirtual

Reimplemented in SG::AuxStoreInternal, xAOD::AuxContainerBase, xAOD::AuxInfoBase, and xAOD::TAuxStore.

Definition at line 187 of file IAuxStore.h.

188  { return nullptr; }

◆ linkedVector() [2/3]

virtual const IAuxTypeVector* SG::IConstAuxStore::linkedVector ( SG::auxid_t  ) const
inlinevirtualinherited

Return interface for a linked variable.

Parameters
auxidThe 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 174 of file IConstAuxStore.h.

175  { return nullptr; }

◆ linkedVector() [3/3]

virtual const IAuxTypeVector* SG::IConstAuxStore::linkedVector
inline

Return interface for a linked variable.

Parameters
auxidThe 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 174 of file IConstAuxStore.h.

175  { return nullptr; }

◆ lock()

virtual void SG::IConstAuxStore::lock ( )
pure virtualinherited

Lock the container.

After this, only decorations can be changed/modified. If the container is already locked, this is a no-op.

Implemented in SG::AuxStoreInternal, xAOD::TAuxStore, xAOD::AuxContainerBase, SG::AuxStoreConstMem, xAOD::ShallowAuxContainer, xAOD::AuxInfoBase, and xAOD::ByteStreamAuxContainer_v1.

◆ lockDecoration()

virtual void SG::IConstAuxStore::lockDecoration ( SG::auxid_t  auxid)
pure virtualinherited

Lock a decoration.

Parameters
auxidIdentifier of the decoration to lock.

A decoration is locked by changing from a decoration to an ordinary variable. If the container itself is locked, then modifications to the variable are not permitted after this call.

Implemented in SG::AuxStoreInternal, SG::AuxStoreConstMem, xAOD::TAuxStore, xAOD::AuxContainerBase, xAOD::ShallowAuxContainer, xAOD::AuxInfoBase, xAOD::ByteStreamAuxContainer_v1, xAOD::EventAuxInfo_v1, xAOD::EventInfoAuxContainer_v1, xAOD::EventAuxInfo_v2, and xAOD::EventAuxInfo_v3.

◆ reserve()

virtual void SG::IAuxStore::reserve ( size_t  sz)
pure virtual

Change the capacity of all aux data vectors.

Parameters
szThe new capacity.

This should be called when the capacity of the container changes (by reserve). This should change the capacity for the vectors for all aux data items.

Implemented in SG::AuxStoreInternal, xAOD::TAuxStore, xAOD::AuxContainerBase, xAOD::ShallowAuxContainer, xAOD::AuxInfoBase, and xAOD::ByteStreamAuxContainer_v1.

◆ resize()

virtual bool SG::IAuxStore::resize ( size_t  sz)
pure virtual

Change the size of all aux data vectors.

Parameters
szThe new size.

This should be called when the size of the container changes. This should resize the vectors for all aux data items.

If the size of the container grows, the new elements should be default-initialized; if it shrinks, destructors should be run as appropriate.

Should return true if it is known that none of the data pointers changed (and thus the cache does not need to be cleared), false otherwise.

Implemented in SG::AuxStoreInternal, xAOD::TAuxStore, xAOD::AuxContainerBase, xAOD::ShallowAuxContainer, xAOD::AuxInfoBase, and xAOD::ByteStreamAuxContainer_v1.

◆ setOption()

virtual bool SG::IAuxStore::setOption ( auxid_t  ,
const AuxDataOption  
)
inlinevirtual

Set an option for a given auxiliary variable.

Parameters
auxidThe identifier of the desired aux data item.
optionThe 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.

174  { return false; }

◆ shift()

virtual void SG::IAuxStore::shift ( size_t  pos,
ptrdiff_t  offs 
)
pure virtual

Shift the elements of the container.

Parameters
posThe starting index for the shift.
offsThe (signed) amount of the shift.

This operation shifts the elements in the vectors for all aux data items, to implement an insertion or deletion. offs may be either positive or negative.

If offs is positive, then the container is growing. The container size should be increased by offs, the element at pos moved to pos + offs, and similarly for following elements. The elements between pos and pos + offs should be default-initialized.

If offs is negative, then the container is shrinking. The element at pos should be moved to pos + offs, and similarly for following elements. The container should then be shrunk by -offs elements (running destructors as appropriate).

Implemented in SG::AuxStoreInternal, xAOD::TAuxStore, xAOD::AuxContainerBase, xAOD::ShallowAuxContainer, xAOD::AuxInfoBase, and xAOD::ByteStreamAuxContainer_v1.

◆ size()

virtual size_t SG::IConstAuxStore::size ( ) const
pure virtualinherited

Return the number of elements in the store.

May return 0 for a store with no aux data.

Implemented in SG::AuxStoreInternal, xAOD::TAuxStore, SG::AuxStoreConstMem, xAOD::AuxContainerBase, xAOD::ShallowAuxContainer, xAOD::AuxInfoBase, xAOD::ByteStreamAuxContainer_v1, RootAuxDynStore, and APRTest::AuxStore.

Member Data Documentation

◆ supportsThinning

constexpr bool SG::IAuxStore::supportsThinning = true
staticconstexpr

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.


The documentation for this class was generated from the following file: