ATLAS Offline Software
Public Member Functions | List of all members
SG::IConstAuxStore Class Referenceabstract

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

#include <IConstAuxStore.h>

Inheritance diagram for SG::IConstAuxStore:
Collaboration diagram for SG::IConstAuxStore:

Public Member Functions

virtual ~IConstAuxStore ()=default
 Destructor. More...
 
virtual const void * getData (SG::auxid_t auxid) const =0
 Return the data vector for one aux data item. More...
 
virtual const IAuxTypeVectorgetVector (SG::auxid_t auxid) const =0
 Return vector interface 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 const SG::auxid_set_tgetDecorIDs () const =0
 Return a set of identifiers for decorations 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...
 

Detailed Description

Interface for const operations on an auxiliary store.

A DataVector may have auxiliary data associated with it. These data are kept in separate AuxStore objects; this defines the interface for const operations on such a store.

An AuxStore may store a number of different aux data items; these are identified by an integer of type auxid_t. Each item is stored as a vector with one entry per entry in the containing DataVector.

This interface provides methods for getting a const pointer to an existing vector of aux data items and for getting the set of existing aux data items.

In addition, sometimes we want to add additional auxiliary data to an existing, const container; this is called ‘decorating’ it. For example, we retrieve a const container from StoreGate, run some algorithm on it, and attach additional data to the object that can be accessed by downstream algorithms or written to a file. To support this, we add the getDecoration operation, as well as lock and clearDecorations. When the object is first being filled, it is unlocked. It gets locked when StoreGateSvc::setConst is called on it. From then on, we can only create decorations. Calling clearDecorations will restore the state back to where it was when lock was called. (Be sure that the container's cache also gets cleared.)

getDecoration then works as follows:

Definition at line 63 of file IConstAuxStore.h.

Constructor & Destructor Documentation

◆ ~IConstAuxStore()

virtual SG::IConstAuxStore::~IConstAuxStore ( )
virtualdefault

Destructor.

Member Function Documentation

◆ clearDecorations()

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

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, SG::AuxStoreConstMem, xAOD::TAuxStore, xAOD::AuxContainerBase, xAOD::ShallowAuxContainer, xAOD::AuxInfoBase, and xAOD::ByteStreamAuxContainer_v1.

◆ getAuxIDs()

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

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()

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

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 nullptr 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.

◆ getDecoration()

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

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.

◆ getDecorIDs()

virtual const SG::auxid_set_t& SG::IConstAuxStore::getDecorIDs ( ) const
pure virtual

◆ getVector()

virtual const IAuxTypeVector* SG::IConstAuxStore::getVector ( SG::auxid_t  auxid) const
pure virtual

Return vector interface for one aux data item.

Parameters
auxidThe identifier of the desired aux data item.

This should return nullptr if the item doesn't exist.

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

◆ isDecoration()

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

◆ linkedVector()

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

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 189 of file IConstAuxStore.h.

190  { return nullptr; }

◆ lock()

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

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, SG::AuxStoreConstMem, xAOD::AuxContainerBase, xAOD::ShallowAuxContainer, xAOD::AuxInfoBase, and xAOD::ByteStreamAuxContainer_v1.

◆ lockDecoration()

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

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.

◆ size()

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

Return the number of elements in the store.

May return 0 for a store with no aux data.

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


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