SG::IAuxTypeVectorFactory Class Reference

Interface for factory objects that create vectors. More...

#include <IAuxTypeVectorFactory.h>

Inheritance diagram for SG::IAuxTypeVectorFactory:
SG::AuxTypeVectorFactory< T > xAOD::TAuxVectorFactory

List of all members.

Public Member Functions

virtual ~IAuxTypeVectorFactory ()
 Destructor.
virtual IAuxTypeVectorcreate (size_t size, size_t capacity) const =0
 Create a vector object of this type.
virtual void copy (void *dst, size_t dst_index, const void *src, size_t src_index) const =0
 Copy an element between vectors.
virtual void swap (void *a, size_t aindex, void *b, size_t bindex) const =0
 Swap an element between vectors.
virtual void clear (void *dst, size_t dst_index) const =0
 Clear an element within a vector (static method).
virtual size_t getEltSize () const =0
 Return the size of an element of this vector type.
virtual const std::type_info * tiVec () const =0
 Return the type_info of the vector.
virtual bool isDynamic () const =0
 True if the vectors created by this factory work by dynamic emulation (via TVirtualCollectionProxy or similar); false if the std::vector code is used directly.

Detailed Description

Interface for factory objects that create vectors.

The auxiliary data for a container are stored in a set of STL vectors, one for each data item. However, we want to allow storing arbitrary types in these vectors. Thus, we define an abstract interface to operate on the vectors, IAuxTypeVector.

Now, we need to registry of how to create an appropriate IAuxTypeVector for a given std::type_info. To make that easier, we encapsulate the creation of those vector objects using this factory interface. There will be one instance of this for each vector type that we deal with. Usually, this interface will be implemented by AuxTypeVector; however, other implementations are used, for example, for reading auxiliary data from root when we don't know its type at compile-time.


Member Function Documentation

virtual void SG::IAuxTypeVectorFactory::clear ( void *  dst,
size_t  dst_index 
) const [pure virtual]

Clear an element within a vector (static method).

Parameters:
dst Pointer to the start of the vector's data.
dst_index Index of the element in the vector.

Implemented in SG::AuxTypeVectorFactory< T >, and xAOD::TAuxVectorFactory.

virtual void SG::IAuxTypeVectorFactory::copy ( void *  dst,
size_t  dst_index,
const void *  src,
size_t  src_index 
) const [pure virtual]

Copy an element between vectors.

Parameters:
dst Pointer to the start of the destination vector's data.
dst_index Index of destination element in the vector.
src Pointer to the start of the source vector's data.
src_index Index of source element in the vector.

dst and @ src can be either the same or different.

Implemented in SG::AuxTypeVectorFactory< T >, and xAOD::TAuxVectorFactory.

virtual IAuxTypeVector* SG::IAuxTypeVectorFactory::create ( size_t  size,
size_t  capacity 
) const [pure virtual]

Create a vector object of this type.

Parameters:
size Initial size of the new vector.
capacity Initial capacity of the new vector.

Implemented in SG::AuxTypeVectorFactory< T >, and xAOD::TAuxVectorFactory.

virtual void SG::IAuxTypeVectorFactory::swap ( void *  a,
size_t  aindex,
void *  b,
size_t  bindex 
) const [pure virtual]

Swap an element between vectors.

Parameters:
a Pointer to the start of the first vector's data.
aindex Index of the element in the first vector.
b Pointer to the start of the second vector's data.
bindex Index of the element in the second vector.

a and @ b can be either the same or different.

Implemented in SG::AuxTypeVectorFactory< T >, and xAOD::TAuxVectorFactory.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 15 Apr 2017 for RootCore Packages by  doxygen 1.6.1