#include <AuxContainerBase.h>
Classes | |
struct | TSAuxidSet |
Helper class for the thread-local auxid set implementation. | |
Public Types | |
typedef SG::auxid_t | auxid_t |
The aux ID type definition. | |
typedef SG::auxid_set_t | auxid_set_t |
The aux ID set type definition. | |
Public Member Functions | |
AuxContainerBase (bool allowDynamicVars=true) | |
Default constructor. | |
AuxContainerBase (const AuxContainerBase &parent) | |
Copy constructor. | |
AuxContainerBase (const SG::IAuxStore *store) | |
Constructor receiving a "dynamic auxiliary store". | |
~AuxContainerBase () | |
Destructor. | |
AuxContainerBase & | operator= (const AuxContainerBase &rhs) |
Assignment operator. | |
Functions implementing the SG::IAuxStoreHolder interface | |
virtual SG::IAuxStore * | getStore () const |
Get the currently used internal store object. | |
virtual void | setStore (SG::IAuxStore *store) |
Set a different internal store object. | |
virtual AuxStoreType | getStoreType () const |
Return the type of the store object. | |
Functions implementing the SG::IConstAuxStore interface | |
virtual const void * | getData (auxid_t auxid) const |
Get a pointer to a given array. | |
virtual const auxid_set_t & | getAuxIDs () const |
Get the types(names) of variables handled by this container. | |
virtual void * | getDecoration (auxid_t auxid, size_t size, size_t capacity) |
Get a pointer to a given array, as a decoration. | |
virtual void | lock () |
Lock the container. | |
virtual void | clearDecorations () |
Clear all decorations. | |
virtual size_t | size () const |
Get the size of the container. | |
Functions implementing the SG::IAuxStore interface | |
virtual void * | getData (auxid_t auxid, size_t size, size_t capacity) |
Get a pointer to a given array, creating the array if necessary. | |
virtual const auxid_set_t & | getWritableAuxIDs () const |
Return a set of writable data identifiers. | |
virtual void | resize (size_t size) |
Resize the arrays to a given size. | |
virtual void | reserve (size_t size) |
Reserve a given size for the arrays. | |
virtual void | shift (size_t pos, ptrdiff_t offs) |
Shift the contents of the stored arrays. | |
virtual bool | setOption (auxid_t id, const SG::AuxDataOption &option) |
Make an option setting on an aux variable. | |
Functions implementing the SG::IAuxStoreIO interface | |
virtual const void * | getIOData (auxid_t auxid) const |
Get a pointer to the data being stored for one aux data item. | |
virtual const std::type_info * | getIOType (auxid_t auxid) const |
Return the type of the data to be stored for one aux data item. | |
virtual const auxid_set_t & | getDynamicAuxIDs () const |
Get the types(names) of variables created dynamically. | |
virtual void | selectAux (const std::set< std::string > &attributes) |
Select dynamic Aux attributes by name (for writing). | |
virtual const SG::auxid_set_t & | getSelectedAuxIDs () const |
Get the IDs of the selected dynamic Aux variables (for writing). | |
Functions managing the instance name of the container | |
const char * | name () const |
Get the name of the container instance. | |
void | setName (const char *name) |
Set the name of the container instance. | |
Protected Member Functions | |
template<typename T > | |
void | regAuxVar (const std::string &name, std::vector< T > &vec) |
Register one of the persistent variables internally. | |
template<typename T > | |
void | regAuxVar (const std::string &name, SG::PackedContainer< T > &vec) |
Register one of the persistent variables internally. |
Common base class for the auxiliary containers
To make the development of auxiliary containers simpler, they can all inherit from this one class. Then all they need to do is just to declare their data members, everything else is taken care of by this transient base class.
xAOD::AuxContainerBase::AuxContainerBase | ( | const AuxContainerBase & | parent | ) |
Copy constructor.
This is an interesting one. The internal variables of AuxContainerBase are set up by the derived class(es) at construction. So, this internal state is not to be copied!
However, since the derived classes (the contents of their regular members) are allowed to be copied, let's not make this constructor private.
xAOD::AuxContainerBase::AuxContainerBase | ( | const SG::IAuxStore * | store | ) |
Constructor receiving a "dynamic auxiliary store".
This constructor is used to wrap another object that is stored in StoreGate, and hence we should not take ownership of.
store | Another store that should be wrapped, but not owned |
AuxContainerBase & xAOD::AuxContainerBase::operator= | ( | const AuxContainerBase & | rhs | ) |
Assignment operator.
Just like the copy constructor, this operator doesn't actually copy anything either. It's just here to make it clear to C++ that the internal state of these objects is not to be messed with.
void xAOD::AuxContainerBase::regAuxVar | ( | const std::string & | name, | |
SG::PackedContainer< T > & | vec | |||
) | [inline, protected] |
Register one of the persistent variables internally.
The user is expected to use this function inside the constructor of the derived class.
name | The name of the variable. Same as the C++ variable's name. | |
vec | A reference to the auxiliary variable inside the object |
void xAOD::AuxContainerBase::regAuxVar | ( | const std::string & | name, | |
std::vector< T > & | vec | |||
) | [inline, protected] |
Register one of the persistent variables internally.
The user is expected to use this function inside the constructor of the derived class.
name | The name of the variable. Same as the C++ variable's name. | |
vec | A reference to the auxiliary variable inside the object |
void xAOD::AuxContainerBase::setStore | ( | SG::IAuxStore * | store | ) | [virtual] |
Set a different internal store object.
This function is used by the I/O infrastructure to possibly put a store object into this one, which can interact with dynamic variables directly.
Note that the object takes ownership of the received store.
store | The store that should be used for dynamic variable handling inside the object from now on |
Implements SG::IAuxStoreHolder.