![]() |
ATLAS Offline Software
|
Interface for factory objects that create vectors. More...
#include <IAuxTypeVectorFactory.h>
Public Member Functions | |
virtual | ~IAuxTypeVectorFactory () |
Destructor. More... | |
virtual std::unique_ptr< IAuxTypeVector > | create (SG::auxid_t auxid, size_t size, size_t capacity, bool isLinked) const =0 |
Create a vector object of this type. More... | |
virtual std::unique_ptr< IAuxTypeVector > | createFromData (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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
virtual size_t | getEltSize () const =0 |
Return the size of an element of this vector type. More... | |
virtual const std::type_info * | tiVec () const =0 |
Return the type_info of the vector. More... | |
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. More... | |
virtual const std::type_info * | tiAlloc () const =0 |
Return the type_info of the vector allocator. More... | |
virtual std::string | tiAllocName () const =0 |
Return the (demangled) name of the vector allocator. More... | |
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.
|
inlinevirtual |
|
pure virtual |
Clear a range of elements within a vector.
auxid | The aux data item being operated on. |
dst | Container holding the element |
dst_index | Index of the first element in the vector. |
n | Number of elements to clear. |
Implemented in xAOD::TAuxVectorFactory, SG::RootAuxVectorFactory, SG::AuxTypeVectorFactoryImpl< T, ALLOC >, SG::AuxTypeVectorFactoryImpl< T, AuxAllocator_t< T > >, and SG::AuxTypeVectorFactoryImpl< ElementLink< DataVector >, AuxAllocator_t< ElementLink< DataVector > > >.
|
inline |
Copy elements between vectors.
auxid | The aux data item being operated on. |
dst | Container for the destination vector. Declared as a rvalue reference to allow passing a temporary here (such as from AuxVectorInterface). |
dst_index | Index of the first destination element in the vector. |
src | Container for the source vector. |
src_index | Index of the first source element in the vector. |
n | Number of elements to copy. |
dst
and @ src can be either the same or different.
Definition at line 132 of file IAuxTypeVectorFactory.h.
|
pure virtual |
Copy elements between vectors.
auxid | The aux data item being operated on. |
dst | Container for the destination vector. |
dst_index | Index of the first destination element in the vector. |
src | Container for the source vector. |
src_index | Index of the first source element in the vector. |
n | Number of elements to copy. |
dst
and @ src can be either the same or different.
Implemented in xAOD::TAuxVectorFactory, SG::RootAuxVectorFactory, SG::AuxTypeVectorFactoryImpl< T, ALLOC >, SG::AuxTypeVectorFactoryImpl< T, AuxAllocator_t< T > >, and SG::AuxTypeVectorFactoryImpl< ElementLink< DataVector >, AuxAllocator_t< ElementLink< DataVector > > >.
|
pure virtual |
Copy elements between vectors, possibly applying thinning.
auxid | The aux data item being operated on. |
dst | Container for the destination vector. |
dst_index | Index of the first destination element in the vector. |
src | Container for the source vector. |
src_index | Index of source element in the vector. |
src_index | Index of the first source element in the vector. |
n | Number of elements to copy. |
dst
and @ src can be either the same or different.
Implemented in xAOD::TAuxVectorFactory, SG::RootAuxVectorFactory, SG::AuxTypeVectorFactoryImpl< T, ALLOC >, SG::AuxTypeVectorFactoryImpl< T, AuxAllocator_t< T > >, and SG::AuxTypeVectorFactoryImpl< ElementLink< DataVector >, AuxAllocator_t< ElementLink< DataVector > > >.
|
pure virtual |
Create a vector object of this type.
auxid | ID for the variable being created. |
size | Initial size of the new vector. |
capacity | Initial capacity of the new vector. |
isLinked | True if this variable is linked from another one. |
Returns a newly-allocated object.
Implemented in SG::RootAuxVectorFactory, SG::AuxTypeVectorFactoryImpl< T, ALLOC >, SG::AuxTypeVectorFactoryImpl< T, AuxAllocator_t< T > >, SG::AuxTypeVectorFactoryImpl< ElementLink< DataVector >, AuxAllocator_t< ElementLink< DataVector > > >, and xAOD::TAuxVectorFactory.
|
pure virtual |
Create a vector object of this type from a data blob.
auxid | ID for the variable being created. |
data | The vector object. |
linkedVector | The interface for another variable linked to this one, or nullptr if there isn't one. (We do not take ownership.) |
isPacked | If true, data is a PackedContainer . |
ownFlag | If true, the newly-created IAuxTypeVector object will take ownership of data . |
isLinked | True 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 xAOD::TAuxVectorFactory, SG::RootAuxVectorFactory, SG::AuxTypeVectorFactoryImpl< T, ALLOC >, SG::AuxTypeVectorFactoryImpl< T, AuxAllocator_t< T > >, and SG::AuxTypeVectorFactoryImpl< ElementLink< DataVector >, AuxAllocator_t< ElementLink< DataVector > > >.
|
pure virtual |
Return the size of an element of this vector type.
Implemented in SG::RootAuxVectorFactory, SG::AuxTypeVectorFactoryImpl< T, ALLOC >, and xAOD::TAuxVectorFactory.
|
pure virtual |
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.
Implemented in SG::RootAuxVectorFactory, SG::AuxTypeVectorFactoryImpl< T, ALLOC >, and xAOD::TAuxVectorFactory.
|
pure virtual |
Swap elements between vectors.
auxid | The aux data item being operated on. |
a | Container for the first vector. |
aindex | Index of the first element in the first vector. |
b | Container for the second vector. |
bindex | Index of the first element in the second vector. |
n | Number of elements to swap. |
a
and @ b can be either the same or different. However, the ranges should not overlap.
Implemented in xAOD::TAuxVectorFactory, SG::RootAuxVectorFactory, SG::AuxTypeVectorFactoryImpl< T, ALLOC >, SG::AuxTypeVectorFactoryImpl< T, AuxAllocator_t< T > >, and SG::AuxTypeVectorFactoryImpl< ElementLink< DataVector >, AuxAllocator_t< ElementLink< DataVector > > >.
|
pure virtual |
Return the type_info
of the vector allocator.
May be nullptr for a dynamic vector.
Implemented in SG::RootAuxVectorFactory, SG::AuxTypeVectorFactoryImpl< T, ALLOC >, and xAOD::TAuxVectorFactory.
|
pure virtual |
Return the (demangled) name of the vector allocator.
Implemented in SG::RootAuxVectorFactory, SG::AuxTypeVectorFactoryImpl< T, ALLOC >, and xAOD::TAuxVectorFactory.
|
pure virtual |
Return the type_info
of the vector.
Implemented in SG::RootAuxVectorFactory, SG::AuxTypeVectorFactoryImpl< T, ALLOC >, and xAOD::TAuxVectorFactory.