![]() |
ATLAS Offline Software
|
Dynamic implementation of IAuxVectorFactory, relying on root's vector proxy.
More...
#include <RootAuxVectorFactory.h>
Public Member Functions | |
| RootAuxVectorFactory (TClass *objClass) | |
| Constructor. | |
| virtual | ~RootAuxVectorFactory () override |
| Destructor. | |
| const RootUtils::Type & | rootType () const |
| Return the ROOT type wrapper. | |
| TClass *objClass | ATLAS_NOT_CONST_THREAD_SAFE () const |
Return the TClass for the overall object. | |
| TClass *vecClass | ATLAS_NOT_CONST_THREAD_SAFE () const |
Return the TClass for the std::vector. | |
| size_t | offset () const |
| Return the offset of the vector within the object. | |
| virtual std::unique_ptr< SG::IAuxTypeVector > | create (SG::auxid_t auxid, size_t size, size_t capacity, bool isLinked) const override |
| Create a vector object of this type. | |
| virtual std::unique_ptr< SG::IAuxTypeVector > | createFromData (SG::auxid_t auxid, void *data, IAuxTypeVector *linkedVector, bool isPacked, bool ownFlag, bool isLinked) const override |
| 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 override |
| 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 override |
| 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 override |
| Swap elements between vectors. | |
| virtual void | clear (SG::auxid_t auxid, AuxVectorData &dst, size_t dst_index, size_t n) const override |
| Clear a range of elements within a vector. | |
| virtual size_t | getEltSize () const override |
| Return the size of an element of this vector type. | |
| virtual const std::type_info * | tiVec () const override |
Return the type_info of the overall object. | |
| virtual bool | isDynamic () const override |
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 override |
Return the type_info of the vector allocator. | |
| virtual std::string | tiAllocName () const override |
| Return the (demangled) name of the vector allocator. | |
| void | toTransient (const EventContext &ctx, RootAuxVector &vec) const |
| Perform post-read processing for one variable. | |
| 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. | |
Private Types | |
| enum | { NONE , ELEMENT_LINK , ELEMENT_LINK_VECTOR , ELEMENT_LINK_NONPOINTER , DATA_LINK , DATA_LINK_VECTOR } |
| Flag to tell whether we need to do thinning / toTrasnsient. More... | |
Private Member Functions | |
| char * | copyImpl (SG::auxid_t auxid, AuxVectorData &dst, size_t dst_index, const AuxVectorData &src, size_t src_index, size_t n) const |
| Helper for copy; returns a pointer to the first destination object, or nullptr if the destination was cleared rather than copied. | |
Private Attributes | |
| TClass * | m_objClass |
The TClass for the overall object. | |
| TClass * | m_vecClass |
The TClass for the std::vector. | |
| size_t | m_offset |
| Offset of the STL vector within the overall object. | |
| RootUtils::Type | m_type |
| Wrapper for the ROOT type of the element. | |
| enum SG::RootAuxVectorFactory:: { ... } | m_isEL |
| Flag to tell whether we need to do thinning / toTrasnsient. | |
Dynamic implementation of IAuxVectorFactory, relying on root's vector proxy.
This is used for the case when we need to manipulate an aux data vector present in an input data file but we have neither a proper template instantiation for the factory (because the variable was never explicitly referenced), nor can we find a dictionary entry for the factory.j
This implementation works by relying entirely on the root dictionary information.
We may either be dealing directly with an STL vector class, or with embedded in another class (as for PackedContainer). Here, vecClass is the class of the STL vector and objClass is the overall object class. In the case of a direct STL vector, these are identical.
Definition at line 285 of file RootAuxVectorFactory.h.
|
private |
Flag to tell whether we need to do thinning / toTrasnsient.
| Enumerator | |
|---|---|
| NONE | |
| ELEMENT_LINK | |
| ELEMENT_LINK_VECTOR | |
| ELEMENT_LINK_NONPOINTER | |
| DATA_LINK | |
| DATA_LINK_VECTOR | |
Definition at line 510 of file RootAuxVectorFactory.h.
| SG::RootAuxVectorFactory::RootAuxVectorFactory | ( | TClass * | objClass | ) |
Constructor.
| vecClass | The TClass for the vector object. |
Definition at line 384 of file RootAuxVectorFactory.cxx.
|
overridevirtual |
|
inline |
Return the TClass for the std::vector.
(Returning non-const TClass* ok here; TClass is internally thread-safe.)
Definition at line 321 of file RootAuxVectorFactory.h.
|
inline |
Return the TClass for the overall object.
(Returning non-const TClass* ok here; TClass is internally thread-safe.)
Definition at line 313 of file RootAuxVectorFactory.h.
|
overridevirtual |
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. |
Implements SG::IAuxTypeVectorFactory.
Definition at line 657 of file RootAuxVectorFactory.cxx.
|
inlineinherited |
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.
|
overridevirtual |
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.
Implements SG::IAuxTypeVectorFactory.
Definition at line 572 of file RootAuxVectorFactory.cxx.
|
overridevirtual |
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.
Implements SG::IAuxTypeVectorFactory.
Definition at line 595 of file RootAuxVectorFactory.cxx.
|
private |
Helper for copy; returns a pointer to the first destination object, or nullptr if the destination was cleared rather than copied.
Definition at line 530 of file RootAuxVectorFactory.cxx.
|
overridevirtual |
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.
| 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. |
Implements SG::IAuxTypeVectorFactory.
Definition at line 484 of file RootAuxVectorFactory.cxx.
|
overridevirtual |
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.
This version does not support packed containers, so isPacked must be false.
Returns a newly-allocated object.
Implements SG::IAuxTypeVectorFactory.
Definition at line 515 of file RootAuxVectorFactory.cxx.
|
overridevirtual |
Return the size of an element of this vector type.
Implements SG::IAuxTypeVectorFactory.
Definition at line 669 of file RootAuxVectorFactory.cxx.
|
overridevirtual |
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.
Implements SG::IAuxTypeVectorFactory.
Definition at line 689 of file RootAuxVectorFactory.cxx.
|
inline |
Return the offset of the vector within the object.
Definition at line 327 of file RootAuxVectorFactory.h.
|
inline |
|
overridevirtual |
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.
Implements SG::IAuxTypeVectorFactory.
Definition at line 638 of file RootAuxVectorFactory.cxx.
|
overridevirtual |
Return the type_info of the vector allocator.
May be nullptr for a dynamic vector.
Implements SG::IAuxTypeVectorFactory.
Definition at line 700 of file RootAuxVectorFactory.cxx.
|
overridevirtual |
Return the (demangled) name of the vector allocator.
Implements SG::IAuxTypeVectorFactory.
Definition at line 709 of file RootAuxVectorFactory.cxx.
|
overridevirtual |
Return the type_info of the overall object.
Implements SG::IAuxTypeVectorFactory.
Definition at line 678 of file RootAuxVectorFactory.cxx.
| void SG::RootAuxVectorFactory::toTransient | ( | const EventContext & | ctx, |
| RootAuxVector & | vec ) const |
Perform post-read processing for one variable.
| ctx | The current event context. |
| vec | The variable to process. |
Some object types require some processing after being read before they are usable. This can be indicated by specializing SG::ToTransient for the vector type containing the variable. This method will call such a ToTransient method on the contents, if one is defined.
Definition at line 736 of file RootAuxVectorFactory.cxx.
| enum { ... } SG::RootAuxVectorFactory::m_isEL |
Flag to tell whether we need to do thinning / toTrasnsient.
|
private |
The TClass for the overall object.
Definition at line 498 of file RootAuxVectorFactory.h.
|
private |
Offset of the STL vector within the overall object.
Definition at line 504 of file RootAuxVectorFactory.h.
|
private |
Wrapper for the ROOT type of the element.
Definition at line 507 of file RootAuxVectorFactory.h.
|
private |
The TClass for the std::vector.
Definition at line 501 of file RootAuxVectorFactory.h.