ATLAS Offline Software
|
Describe one element of a jagged vector (base class). More...
#include <JaggedVecImpl.h>
Classes | |
struct | Shift |
Helper to shift indices. More... | |
Public Types | |
using | index_type = uint32_t |
Type for the indices. More... | |
Public Member Functions | |
JaggedVecEltBase ()=default | |
Default constructor. More... | |
JaggedVecEltBase (index_type end) | |
Constructor. More... | |
index_type | begin (size_t elt_ndx) const |
Return the index of the beginning of the range. More... | |
index_type | end () const |
Return the index of the end of the range. More... | |
size_t | size (size_t elt_ndx) const |
Return the number of items in this range. More... | |
bool | operator== (const JaggedVecEltBase &other) const |
Equality test. More... | |
Private Attributes | |
index_type | m_end = 0 |
End index. More... | |
Friends | |
struct | Shift |
Describe one element of a jagged vector (base class).
Each jagged vector element holds its end index into the linked payload vector. The begin index is given by the end index of the previous element. Thus, these elements must be allocated as a contiguous vector. Further, in order to get the begin index, we need to know the index of this element object within its vector — because we have to special-case the first element.
For example, if we have a jagged vector with three elements of sizes 3, 1, 2, then what we would store is {3, 4, 6}.
This implies that one cannot interpret a JaggedVecElt
in isolation (or a range of them); we need to know where they are stored in the xAOD variable vector. Fortunately, that's not something that is typically done, since jagged vectors are accessed via the specialized Accessor
classes.
This non-templated base class holds the actual data. However, users should use the JaggedVecElt<PAYLOAD>
derived types, to allow specifying the payload type.
Definition at line 51 of file JaggedVecImpl.h.
using SG::JaggedVecEltBase::index_type = uint32_t |
Type for the indices.
16 bits is probably too small, 64 bits is pretty definitely too large. Use 32.
Definition at line 56 of file JaggedVecImpl.h.
|
default |
Default constructor.
Makes a null range.
SG::JaggedVecEltBase::JaggedVecEltBase | ( | index_type | end | ) |
Constructor.
beg | Index of the start of the range. |
end | Index of the end of the range. |
index_type SG::JaggedVecEltBase::begin | ( | size_t | elt_ndx | ) | const |
Return the index of the beginning of the range.
elt_ndx | The index of this element in its container. |
index_type SG::JaggedVecEltBase::end | ( | ) | const |
Return the index of the end of the range.
bool SG::JaggedVecEltBase::operator== | ( | const JaggedVecEltBase & | other | ) | const |
Equality test.
other | Other element with which to compare. |
size_t SG::JaggedVecEltBase::size | ( | size_t | elt_ndx | ) | const |
Return the number of items in this range.
elt_ndx | The index of this element in its container. |
|
friend |
Definition at line 119 of file JaggedVecImpl.h.
|
private |
End index.
Definition at line 122 of file JaggedVecImpl.h.