ATLAS Offline Software
Loading...
Searching...
No Matches
SG::IAuxTypeVectorFactory Class Referenceabstract

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

#include <IAuxTypeVectorFactory.h>

Inherited by SG::AuxTypeVectorFactoryImpl< T, ALLOC >, SG::AuxTypeVectorFactoryImpl< Elt, ALLOC >, SG::AuxTypeVectorFactoryImpl< PackedLink< CONT >, ALLOC >, SG::AuxTypeVectorFactoryImpl< VELT, ALLOC >, SG::AuxTypeVectorFactoryImpl< T, AuxAllocator_t< T > >, SG::AuxTypeVectorFactoryImpl< JaggedVecElt< T >, AuxAllocator_t< JaggedVecElt< T > > >, SG::AuxTypeVectorFactoryImpl< typename AuxDataTraits< PackedLink< CONT >, AuxAllocator_t< PackedLink< CONT > > >::vector_type, AuxAllocator_t< typename AuxDataTraits< PackedLink< CONT >, AuxAllocator_t< PackedLink< CONT > > >::vector_type > >, SG::AuxTypeVectorFactoryImpl< PackedLink< CONT >, AuxAllocator_t< PackedLink< CONT > > >, SG::AuxTypeVectorFactoryImpl< T, ALLOC >, SG::RootAuxVectorFactory, and xAOD::TAuxVectorFactory.

Collaboration diagram for SG::IAuxTypeVectorFactory:

Public Member Functions

virtual ~IAuxTypeVectorFactory ()
 Destructor.
virtual std::unique_ptr< IAuxTypeVectorcreate (SG::auxid_t auxid, size_t size, size_t capacity, bool isLinked) const =0
 Create a vector object of this type.
virtual std::unique_ptr< IAuxTypeVectorcreateFromData (SG::auxid_t auxid, void *data, IAuxTypeVector *linkedVector, bool isPacked, bool ownFlag, bool isLinked) const =0
 Create a vector object of this type from a data blob.
virtual void copy (SG::auxid_t auxid, AuxVectorData &dst, size_t dst_index, const AuxVectorData &src, size_t src_index, size_t n) const =0
 Copy elements between vectors.
void copy (SG::auxid_t auxid, AuxVectorData &&dst, size_t dst_index, const AuxVectorData &src, size_t src_index, size_t n) const
 Copy elements between vectors.
virtual void copyForOutput (SG::auxid_t auxid, AuxVectorData &dst, size_t dst_index, const AuxVectorData &src, size_t src_index, size_t n) const =0
 Copy elements between vectors, possibly applying thinning.
virtual void swap (SG::auxid_t auxid, AuxVectorData &a, size_t aindex, AuxVectorData &b, size_t bindex, size_t n) const =0
 Swap elements between vectors.
virtual void clear (SG::auxid_t auxid, AuxVectorData &dst, size_t dst_index, size_t n) const =0
 Clear a range of elements within a vector.
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.
virtual const std::type_info * tiAlloc () const =0
 Return the type_info of the vector allocator.
virtual std::string tiAllocName () const =0
 Return the (demangled) name of the vector allocator.

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.

Definition at line 49 of file IAuxTypeVectorFactory.h.

Constructor & Destructor Documentation

◆ ~IAuxTypeVectorFactory()

virtual SG::IAuxTypeVectorFactory::~IAuxTypeVectorFactory ( )
inlinevirtual

Destructor.

Definition at line 55 of file IAuxTypeVectorFactory.h.

55{}

Member Function Documentation

◆ clear()

◆ copy() [1/2]

void SG::IAuxTypeVectorFactory::copy ( SG::auxid_t auxid,
AuxVectorData && dst,
size_t dst_index,
const AuxVectorData & src,
size_t src_index,
size_t n ) const
inline

Copy elements between vectors.

Parameters
auxidThe aux data item being operated on.
dstContainer for the destination vector. Declared as a rvalue reference to allow passing a temporary here (such as from AuxVectorInterface).
dst_indexIndex of the first destination element in the vector.
srcContainer for the source vector.
src_indexIndex of the first source element in the vector.
nNumber of elements to copy.

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

Definition at line 132 of file IAuxTypeVectorFactory.h.

136 {
137 copy (auxid, dst, dst_index, src, src_index, n);
138 }
virtual void copy(SG::auxid_t auxid, AuxVectorData &dst, size_t dst_index, const AuxVectorData &src, size_t src_index, size_t n) const =0
Copy elements between vectors.

◆ copy() [2/2]

virtual void SG::IAuxTypeVectorFactory::copy ( SG::auxid_t auxid,
AuxVectorData & dst,
size_t dst_index,
const AuxVectorData & src,
size_t src_index,
size_t n ) const
pure virtual

◆ copyForOutput()

virtual void SG::IAuxTypeVectorFactory::copyForOutput ( SG::auxid_t auxid,
AuxVectorData & dst,
size_t dst_index,
const AuxVectorData & src,
size_t src_index,
size_t n ) const
pure virtual

Copy elements between vectors, possibly applying thinning.

Parameters
auxidThe aux data item being operated on.
dstContainer for the destination vector.
dst_indexIndex of the first destination element in the vector.
srcContainer for the source vector.
src_indexIndex of source element in the vector.
src_indexIndex of the first source element in the vector.
nNumber of elements to copy.

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

Implemented in SG::AuxTypeVectorFactoryImpl< T, ALLOC >, SG::AuxTypeVectorFactoryImpl< Elt, ALLOC >, SG::AuxTypeVectorFactoryImpl< JaggedVecElt< T >, AuxAllocator_t< JaggedVecElt< T > > >, SG::AuxTypeVectorFactoryImpl< PackedLink< CONT >, ALLOC >, SG::AuxTypeVectorFactoryImpl< PackedLink< CONT >, AuxAllocator_t< PackedLink< CONT > > >, SG::AuxTypeVectorFactoryImpl< T, ALLOC >, SG::AuxTypeVectorFactoryImpl< T, AuxAllocator_t< T > >, SG::AuxTypeVectorFactoryImpl< typename AuxDataTraits< PackedLink< CONT >, AuxAllocator_t< PackedLink< CONT > > >::vector_type, AuxAllocator_t< typename AuxDataTraits< PackedLink< CONT >, AuxAllocator_t< PackedLink< CONT > > >::vector_type > >, SG::AuxTypeVectorFactoryImpl< VELT, ALLOC >, SG::JaggedVecVectorFactory< T, ALLOC >, SG::JaggedVecVectorFactory< T, ALLOC >, SG::PackedLinkVectorFactory< CONT, ALLOC >, SG::PackedLinkVectorFactory< CONT, ALLOC >, SG::PackedLinkVVectorFactory< CONT, VALLOC, VELT, ALLOC >, SG::PackedLinkVVectorFactory< CONT, VALLOC, std::vector< PackedLink< CONT >, VALLOC >, ALLOC >, SG::RootAuxVectorFactory, and xAOD::TAuxVectorFactory.

◆ create()

virtual std::unique_ptr< IAuxTypeVector > SG::IAuxTypeVectorFactory::create ( SG::auxid_t auxid,
size_t size,
size_t capacity,
bool isLinked ) const
pure virtual

◆ createFromData()

virtual std::unique_ptr< IAuxTypeVector > SG::IAuxTypeVectorFactory::createFromData ( SG::auxid_t auxid,
void * data,
IAuxTypeVector * linkedVector,
bool isPacked,
bool ownFlag,
bool isLinked ) const
pure virtual

Create a vector object of this type from a data blob.

Parameters
auxidID for the variable being created.
dataThe vector object.
linkedVectorThe interface for another variable linked to this one, or nullptr if there isn't one. (We do not take ownership.)
isPackedIf true, data is a PackedContainer.
ownFlagIf true, the newly-created IAuxTypeVector object will take ownership of data.
isLinkedTrue if this variable is linked from another one.

If the element type is T, then data should be a pointer to a std::vector<T> object, which was obtained with new. But if isPacked is true, then data should instead point at an object of type SG::PackedContainer<T>.

Returns a newly-allocated object.

Implemented in SG::AuxTypeVectorFactoryImpl< T, ALLOC >, SG::AuxTypeVectorFactoryImpl< Elt, ALLOC >, SG::AuxTypeVectorFactoryImpl< JaggedVecElt< T >, AuxAllocator_t< JaggedVecElt< T > > >, SG::AuxTypeVectorFactoryImpl< PackedLink< CONT >, ALLOC >, SG::AuxTypeVectorFactoryImpl< PackedLink< CONT >, AuxAllocator_t< PackedLink< CONT > > >, SG::AuxTypeVectorFactoryImpl< T, ALLOC >, SG::AuxTypeVectorFactoryImpl< T, AuxAllocator_t< T > >, SG::AuxTypeVectorFactoryImpl< typename AuxDataTraits< PackedLink< CONT >, AuxAllocator_t< PackedLink< CONT > > >::vector_type, AuxAllocator_t< typename AuxDataTraits< PackedLink< CONT >, AuxAllocator_t< PackedLink< CONT > > >::vector_type > >, SG::AuxTypeVectorFactoryImpl< VELT, ALLOC >, SG::JaggedVecVectorFactory< T, ALLOC >, SG::JaggedVecVectorFactory< T, ALLOC >, SG::PackedLinkVectorFactory< CONT, ALLOC >, SG::PackedLinkVectorFactory< CONT, ALLOC >, SG::PackedLinkVVectorFactory< CONT, VALLOC, VELT, ALLOC >, SG::PackedLinkVVectorFactory< CONT, VALLOC, std::vector< PackedLink< CONT >, VALLOC >, ALLOC >, SG::RootAuxVectorFactory, and xAOD::TAuxVectorFactory.

◆ getEltSize()

◆ isDynamic()

◆ swap()

virtual void SG::IAuxTypeVectorFactory::swap ( SG::auxid_t auxid,
AuxVectorData & a,
size_t aindex,
AuxVectorData & b,
size_t bindex,
size_t n ) const
pure virtual

◆ tiAlloc()

◆ tiAllocName()

◆ tiVec()


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