ATLAS Offline Software
|
Auxiliary vector type for types known to ROOT. More...
#include <TAuxVector.h>
Public Member Functions | |
TAuxVector (const TAuxVectorFactory *factory, SG::auxid_t auxid, const ::TClass *cl, size_t size, size_t capacity) | |
Constructor. More... | |
TAuxVector (const TAuxVector &parent) | |
Copy constructor. More... | |
~TAuxVector () | |
Destructor. More... | |
TAuxVector & | operator= (const TAuxVector &other) |
Assignment operator. More... | |
virtual bool | setOption (const AuxDataOption &) |
Set an option for this variable. More... | |
virtual std::unique_ptr< IAuxTypeVector > | toPacked () |
Make a packed version of the variable. More... | |
virtual const std::type_info * | objType () const |
Return the type of the complete object to be saved. More... | |
Function implementing the SG::IAuxTypeVector interface | |
virtual std::unique_ptr< SG::IAuxTypeVector > | clone () const override |
Copy the managed vector. More... | |
virtual SG::auxid_t | auxid () const override |
Return the auxid of the variable this vector represents. More... | |
virtual void * | toPtr () override |
Return a pointer to the start of the vector's data. More... | |
virtual const void * | toPtr () const override |
Return a pointer to the start of the vector's data. More... | |
virtual void * | toVector () override |
Return a pointer to the STL vector itself. More... | |
virtual size_t | size () const override |
Return the size of the vector. More... | |
virtual bool | resize (size_t sz) override |
Change the size of the vector. More... | |
virtual void | reserve (size_t sz) override |
Change the capacity of the vector. More... | |
virtual bool | shift (size_t pos, ptrdiff_t offs) override |
Shift the elements of the vector. More... | |
virtual bool | insertMove (size_t pos, void *beg, void *end, SG::IAuxStore &srcStore) override |
Insert a range of elements via move. More... | |
Private Member Functions | |
void | copyRange (const void *src, void *dst, size_t n) |
Function copying the payload of a range to a new location. More... | |
void | clearRange (void *dst, size_t n) |
Private Attributes | |
const TAuxVectorFactory * | m_factory |
The parent factory object. More... | |
std::unique_ptr<::TVirtualCollectionProxy > | m_proxy |
ROOT's description of the vector type Cloned from the proxy held by the TClass and permanently bound to m_vec. More... | |
void * | m_vec |
Pointer to the vector object. More... | |
SG::auxid_t | m_auxid |
ID of the variable we represent. More... | |
Auxiliary vector type for types known to ROOT.
This class is used for types known to ROOT, which have not received a concrete auxiliary vector type yet. (By having been accessed explicitly.)
The code is pretty much a copy of what Scott wrote for RootStorageSvc for the offline code.
Definition at line 30 of file TAuxVector.h.
xAOD::TAuxVector::TAuxVector | ( | const TAuxVectorFactory * | factory, |
SG::auxid_t | auxid, | ||
const ::TClass * | cl, | ||
size_t | size, | ||
size_t | capacity | ||
) |
xAOD::TAuxVector::TAuxVector | ( | const TAuxVector & | parent | ) |
xAOD::TAuxVector::~TAuxVector | ( | ) |
Destructor.
Definition at line 65 of file TAuxVector.cxx.
|
overridevirtual |
Return the auxid of the variable this vector represents.
Implements SG::IAuxTypeVector.
Definition at line 112 of file TAuxVector.cxx.
|
private |
Definition at line 238 of file TAuxVector.cxx.
|
overridevirtual |
Copy the managed vector.
Implements SG::IAuxTypeVector.
Definition at line 106 of file TAuxVector.cxx.
|
private |
Function copying the payload of a range to a new location.
Definition at line 227 of file TAuxVector.cxx.
|
overridevirtual |
Insert a range of elements via move.
Implements SG::IAuxTypeVector.
Definition at line 206 of file TAuxVector.cxx.
|
inlinevirtualinherited |
Return the type of the complete object to be saved.
For example, if the object is a std::vector
, then we return the type_info
of the vector. But if we're holding a PackedContainer
, then we return the type_info
of the PackedContainer
.
Can return null if the operation is not supported. In that case, I/O will use the type found from the variable registry.
Reimplemented in SG::RootAuxVector, SG::AuxTypeVectorHolder< T, CONT >, and xAOD::AuxPersInfo< T >.
Definition at line 192 of file IAuxTypeVector.h.
TAuxVector & xAOD::TAuxVector::operator= | ( | const TAuxVector & | other | ) |
|
overridevirtual |
Change the capacity of the vector.
Implements SG::IAuxTypeVector.
Definition at line 145 of file TAuxVector.cxx.
|
overridevirtual |
Change the size of the vector.
Implements SG::IAuxTypeVector.
Definition at line 138 of file TAuxVector.cxx.
|
inlinevirtualinherited |
Set an option for this variable.
option | The option to set. |
The interpretation of the option depends on the particular representation of the variable provided by the concrete class.
Returns true if the option setting was successful; false otherwise.
Reimplemented in SG::AuxTypeVectorHolder< T, CONT >, and SG::AuxTypeVectorHolder< T, std::vector< T > >.
Definition at line 162 of file IAuxTypeVector.h.
|
overridevirtual |
Shift the elements of the vector.
pos | The starting index for the shift. |
offs | The (signed) amount of the shift. |
This operation shifts the elements in the vectors for all aux data items, to implement an insertion or deletion. offs
may be either positive or negative.
If offs
is positive, then the container is growing. The container size should be increased by offs
, the element at pos
moved to pos
+ offs
, and similarly for following elements. The elements between pos
and pos
+ offs
should be default-initialized.
If offs
is negative, then the container is shrinking. The element at pos
should be moved to pos
+ offs
, and similarly for following elements. The container should then be shrunk by -offs
elements (running destructors as appropriate).
Returns true if it is known that iterators have not been invalidated; false otherwise. (Will always return false when increasing the size of an empty container.)
Implements SG::IAuxTypeVector.
Definition at line 176 of file TAuxVector.cxx.
|
overridevirtual |
Return the size of the vector.
Implements SG::IAuxTypeVector.
Definition at line 133 of file TAuxVector.cxx.
|
inlinevirtualinherited |
Make a packed version of the variable.
If possible, return a new vector object that stores the data in a PackedContainer
. The data itself should be moved to the new container (so that this vector becomes empty). This ensures that pointers to the data are preserved.
If successful, a newly-allocated object is returned. A null pointer is returned on failure (operation not supported, type can't be packed, type is already packed).
Reimplemented in SG::AuxTypeVectorHolder< T, CONT >, and SG::AuxTypeVectorHolder< T, std::vector< T > >.
Definition at line 178 of file IAuxTypeVector.h.
|
overridevirtual |
Return a pointer to the start of the vector's data.
Implements SG::IAuxTypeVector.
Definition at line 123 of file TAuxVector.cxx.
|
overridevirtual |
Return a pointer to the start of the vector's data.
Implements SG::IAuxTypeVector.
Definition at line 118 of file TAuxVector.cxx.
|
overridevirtual |
Return a pointer to the STL vector itself.
Implements SG::IAuxTypeVector.
Definition at line 128 of file TAuxVector.cxx.
|
private |
ID of the variable we represent.
Definition at line 90 of file TAuxVector.h.
|
private |
The parent factory object.
Definition at line 81 of file TAuxVector.h.
|
private |
ROOT's description of the vector type Cloned from the proxy held by the TClass and permanently bound to m_vec.
That makes things a bit more efficient, and prevents potential thread-safety problems.
Definition at line 86 of file TAuxVector.h.
|
private |
Pointer to the vector object.
Definition at line 88 of file TAuxVector.h.