![]() |
ATLAS Offline Software
|
Proxy for jagged vectors. More...
#include <JaggedVecConversions.h>
Classes | |
struct | nonnull_iterator |
Helper for passing iterators. More... | |
Public Types | |
using | Payload_t = PAYLOAD_T |
The payload type. More... | |
using | Payload_span = detail::AuxDataSpan< Payload_t > |
using | Elt_t = JaggedVecProxyBase::Elt_t |
Type of one jagged vector element. We use the type-independent base. More... | |
using | index_type = typename Elt_t::index_type |
using | Elt_span = JaggedVecProxyBase::Elt_span |
using | element_type = Payload_t |
Standard type aliases. More... | |
using | value_type = std::remove_cv_t< element_type > |
using | size_type = std::size_t |
using | difference_type = std::ptrdiff_t |
using | pointer = element_type * |
using | const_pointer = const element_type * |
using | reference = element_type & |
using | const_reference = const element_type & |
using | iterator = pointer |
Use pointers as iterators. More... | |
using | const_iterator = const_pointer |
using | reverse_iterator = std::reverse_iterator< iterator > |
using | const_reverse_iterator = std::reverse_iterator< const_iterator > |
Public Member Functions | |
JaggedVecProxyT (size_t elt_index, Payload_span payload, const AuxDataSpanBase &elts, AuxVectorData &container, SG::auxid_t auxid) | |
Constructor. More... | |
JaggedVecProxyT (size_t elt_index, Payload_span payload, JaggedVecProxyBase &base) | |
Constructor. More... | |
size_t | size () const noexcept |
Return the size of this jagged vector element. More... | |
bool | empty () const noexcept |
Test if this jagged vector element is empty. More... | |
reference | operator[] (size_t i) noexcept |
Element access (non-const). More... | |
const_reference | operator[] (size_t i) const noexcept |
Element access (const). More... | |
reference | at (size_t i) |
Element access (non-const, bounds-checked). More... | |
const_reference | at (size_t i) const |
Element access (const, bounds-checked). More... | |
reference | front () noexcept |
Return a reference to the first item in this element's payload. More... | |
const_reference | front () const noexcept |
Return the first item in this element's payload. More... | |
reference | back () noexcept |
Return a reference to the last item in this element's payload. More... | |
const_reference | back () const noexcept |
Return the last item in this element's payload. More... | |
iterator | begin () noexcept |
Return a (non-const) begin iterator. More... | |
iterator | end () noexcept |
Return a (non-const) end iterator. More... | |
const_iterator | begin () const noexcept |
Return a (const) begin iterator. More... | |
const_iterator | end () const noexcept |
Return a (const) end iterator. More... | |
const_iterator | cbegin () const noexcept |
Return a (const) begin iterator. More... | |
const_iterator | cend () const noexcept |
Return a (const) end iterator. More... | |
reverse_iterator | rbegin () noexcept |
Return a (non-const) begin reverse iterator. More... | |
reverse_iterator | rend () noexcept |
Return a (non-const) end reverse iterator. More... | |
const_reverse_iterator | rbegin () const noexcept |
Return a (const) begin reverse iterator. More... | |
const_reverse_iterator | rend () const noexcept |
Return a (const) end reverse iterator. More... | |
const_reverse_iterator | crbegin () const noexcept |
Return a (const) begin reverse iterator. More... | |
const_reverse_iterator | crend () const noexcept |
Return a (const) end reverse iterator. More... | |
template<CxxUtils::InputRangeOverT< PAYLOAD_T > RANGE> | |
JaggedVecProxyT & | operator= (const RANGE &range) |
Assign this jagged vector element from a range. More... | |
std::vector< Payload_t > | asVector () const |
Convert this jagged vector element to a vector. More... | |
template<class VALLOC > | |
operator std::vector< Payload_t, VALLOC > () const | |
Convert this jagged vector element to a vector. More... | |
void | push_back (const Payload_t &x) |
Add an item to the end of this jagged vector element. More... | |
void | clear () |
Clear this jagged vector element. More... | |
void | resize (size_t n, const Payload_t &x=Payload_t()) |
Resize this jagged vector element. More... | |
void | erase (nonnull_iterator pos) |
Erase one item from this jagged vector element. More... | |
void | erase (index_type pos) |
Erase one item from this jagged vector element. More... | |
void | erase (nonnull_iterator first, nonnull_iterator last) |
Erase a range of items from this jagged vector element. More... | |
void | erase (index_type first, index_type last) |
Erase a range of items from this jagged vector element. More... | |
void | insert (nonnull_iterator pos, const Payload_t &x) |
Insert an item into this jagged vector element. More... | |
void | insert (index_type pos, const Payload_t &x) |
Insert an item into this jagged vector element. More... | |
void | insert (nonnull_iterator pos, size_t n, const Payload_t &x) |
Insert a number of items into this jagged vector element. More... | |
void | insert (index_type pos, size_t n, const Payload_t &x) |
Insert a number of items into this jagged vector element. More... | |
template<CxxUtils::detail::InputValIterator< PAYLOAD_T > ITERATOR> | |
void | insert (nonnull_iterator pos, ITERATOR first, ITERATOR last) |
Insert a range of items into this jagged vector element. More... | |
template<CxxUtils::detail::InputValIterator< PAYLOAD_T > ITERATOR> | |
void | insert (index_type pos, ITERATOR first, ITERATOR last) |
Insert a range of items into this jagged vector element. More... | |
template<CxxUtils::InputRangeOverT< PAYLOAD_T > RANGE> | |
void | insert_range (nonnull_iterator pos, const RANGE &range) |
Insert a range of items into this jagged vector element. More... | |
template<CxxUtils::InputRangeOverT< PAYLOAD_T > RANGE> | |
void | insert_range (index_type pos, const RANGE &range) |
Insert a range of items into this jagged vector element. More... | |
template<CxxUtils::InputRangeOverT< PAYLOAD_T > RANGE> | |
void | append_range (const RANGE &range) |
Append a range of items to the end of this jagged vector element. More... | |
void | pop_back () |
Remove the last item from this jagged vector element. More... | |
void | assign (size_t n, const Payload_t &x) |
Set this jagged vector element to a number of items. More... | |
template<CxxUtils::detail::InputValIterator< PAYLOAD_T > ITERATOR> | |
void | assign (ITERATOR first, ITERATOR last) |
Assign this jagged vector element from a range. More... | |
template<CxxUtils::InputRangeOverT< PAYLOAD_T > RANGE> | |
void | assign_range (const RANGE &range) |
Assign this jagged vector element from a range. More... | |
Private Member Functions | |
Elt_t & | elt () noexcept |
Return a reference to this proxy's element. More... | |
const Elt_t & | elt () const noexcept |
Return a (const) reference to this proxy's element. More... | |
size_t | elt_begin () const noexcept |
Return the begin payload index of this proxy's element. More... | |
size_t | elt_end () const noexcept |
Return the end payload index of this proxy's element. More... | |
Private Attributes | |
size_t | m_index |
Index of the element we're proxying. More... | |
Payload_span | m_payload |
Reference to a span over the payload vector. More... | |
Proxy for jagged vectors.
We want to be able to do things like:
That means that the Accessor
needs to return a proxy object that implements vector-like operations for modifying the jagged vector data. This is the purpose of this proxy class.
In the case where we're dealing with a span over jagged vector elements, we'd like each proxy to share the type-independent base data (JaggedVectorProxyBase
). In that case, for example, we only need to fetch the IAuxTypeVector
pointer once for everything in the span. But if the proxy is used by itself, then we don't gain anything from that, but we would have to pay the price of another layer of indirection. So the dependency on this data is factored out into the BASE
base class, which can hold that data either by reference or by value.
Definition at line 248 of file JaggedVecConversions.h.
using SG::detail::JaggedVecProxyT< PAYLOAD_T, BASE >::const_iterator = const_pointer |
Definition at line 274 of file JaggedVecConversions.h.
using SG::detail::JaggedVecProxyT< PAYLOAD_T, BASE >::const_pointer = const element_type* |
Definition at line 268 of file JaggedVecConversions.h.
using SG::detail::JaggedVecProxyT< PAYLOAD_T, BASE >::const_reference = const element_type& |
Definition at line 270 of file JaggedVecConversions.h.
using SG::detail::JaggedVecProxyT< PAYLOAD_T, BASE >::const_reverse_iterator = std::reverse_iterator<const_iterator> |
Definition at line 276 of file JaggedVecConversions.h.
using SG::detail::JaggedVecProxyT< PAYLOAD_T, BASE >::difference_type = std::ptrdiff_t |
Definition at line 266 of file JaggedVecConversions.h.
using SG::detail::JaggedVecProxyT< PAYLOAD_T, BASE >::element_type = Payload_t |
Standard type aliases.
Definition at line 263 of file JaggedVecConversions.h.
using SG::detail::JaggedVecProxyT< PAYLOAD_T, BASE >::Elt_span = JaggedVecProxyBase::Elt_span |
Definition at line 259 of file JaggedVecConversions.h.
using SG::detail::JaggedVecProxyT< PAYLOAD_T, BASE >::Elt_t = JaggedVecProxyBase::Elt_t |
Type of one jagged vector element. We use the type-independent base.
Definition at line 257 of file JaggedVecConversions.h.
using SG::detail::JaggedVecProxyT< PAYLOAD_T, BASE >::index_type = typename Elt_t::index_type |
Definition at line 258 of file JaggedVecConversions.h.
using SG::detail::JaggedVecProxyT< PAYLOAD_T, BASE >::iterator = pointer |
Use pointers as iterators.
Definition at line 273 of file JaggedVecConversions.h.
using SG::detail::JaggedVecProxyT< PAYLOAD_T, BASE >::Payload_span = detail::AuxDataSpan<Payload_t> |
Definition at line 254 of file JaggedVecConversions.h.
using SG::detail::JaggedVecProxyT< PAYLOAD_T, BASE >::Payload_t = PAYLOAD_T |
The payload type.
Definition at line 253 of file JaggedVecConversions.h.
using SG::detail::JaggedVecProxyT< PAYLOAD_T, BASE >::pointer = element_type* |
Definition at line 267 of file JaggedVecConversions.h.
using SG::detail::JaggedVecProxyT< PAYLOAD_T, BASE >::reference = element_type& |
Definition at line 269 of file JaggedVecConversions.h.
using SG::detail::JaggedVecProxyT< PAYLOAD_T, BASE >::reverse_iterator = std::reverse_iterator<iterator> |
Definition at line 275 of file JaggedVecConversions.h.
using SG::detail::JaggedVecProxyT< PAYLOAD_T, BASE >::size_type = std::size_t |
Definition at line 265 of file JaggedVecConversions.h.
using SG::detail::JaggedVecProxyT< PAYLOAD_T, BASE >::value_type = std::remove_cv_t<element_type> |
Definition at line 264 of file JaggedVecConversions.h.
SG::detail::JaggedVecProxyT< PAYLOAD_T, BASE >::JaggedVecProxyT | ( | size_t | elt_index, |
Payload_span | payload, | ||
const AuxDataSpanBase & | elts, | ||
AuxVectorData & | container, | ||
SG::auxid_t | auxid | ||
) |
Constructor.
elt_index | Index of the jagged vector element. |
payload | Reference to a range over the payload vector. |
elts | The elements of the jagged vector. |
container | The container holding this variable. |
auxid | The aux ID of this variable. |
SG::detail::JaggedVecProxyT< PAYLOAD_T, BASE >::JaggedVecProxyT | ( | size_t | elt_index, |
Payload_span | payload, | ||
JaggedVecProxyBase & | base | ||
) |
Constructor.
elt_index | Index of the jagged vector element. |
payload | Reference to a range over the payload vector. |
base | The base information. |
void SG::detail::JaggedVecProxyT< PAYLOAD_T, BASE >::append_range | ( | const RANGE & | range | ) |
Append a range of items to the end of this jagged vector element.
range | The range to append. |
void SG::detail::JaggedVecProxyT< PAYLOAD_T, BASE >::assign | ( | ITERATOR | first, |
ITERATOR | last | ||
) |
Assign this jagged vector element from a range.
first | Start of the range to assign. |
last | End of the range to assign. |
void SG::detail::JaggedVecProxyT< PAYLOAD_T, BASE >::assign | ( | size_t | n, |
const Payload_t & | x | ||
) |
Set this jagged vector element to a number of items.
n | The number of items to assign. |
x | The value to assign. |
void SG::detail::JaggedVecProxyT< PAYLOAD_T, BASE >::assign_range | ( | const RANGE & | range | ) |
Assign this jagged vector element from a range.
range | The range from which to assign. |
std::vector<Payload_t> SG::detail::JaggedVecProxyT< PAYLOAD_T, BASE >::asVector | ( | ) | const |
Convert this jagged vector element to a vector.
reference SG::detail::JaggedVecProxyT< PAYLOAD_T, BASE >::at | ( | size_t | i | ) |
Element access (non-const, bounds-checked).
i | Index within this element's payload. |
const_reference SG::detail::JaggedVecProxyT< PAYLOAD_T, BASE >::at | ( | size_t | i | ) | const |
Element access (const, bounds-checked).
i | Index within this element's payload. |
|
noexcept |
Return the last item in this element's payload.
|
noexcept |
Return a reference to the last item in this element's payload.
|
noexcept |
Return a (const) begin iterator.
|
noexcept |
Return a (non-const) begin iterator.
|
noexcept |
Return a (const) begin iterator.
|
noexcept |
Return a (const) end iterator.
void SG::detail::JaggedVecProxyT< PAYLOAD_T, BASE >::clear | ( | ) |
Clear this jagged vector element.
|
noexcept |
Return a (const) begin reverse iterator.
|
noexcept |
Return a (const) end reverse iterator.
|
privatenoexcept |
Return a (const) reference to this proxy's element.
|
privatenoexcept |
Return a reference to this proxy's element.
|
privatenoexcept |
Return the begin payload index of this proxy's element.
|
privatenoexcept |
Return the end payload index of this proxy's element.
|
noexcept |
Test if this jagged vector element is empty.
|
noexcept |
Return a (const) end iterator.
|
noexcept |
Return a (non-const) end iterator.
void SG::detail::JaggedVecProxyT< PAYLOAD_T, BASE >::erase | ( | index_type | first, |
index_type | last | ||
) |
Erase a range of items from this jagged vector element.
first | Index within the element of the first item to erase. |
last | One past the index within the element of the last item to erase. |
void SG::detail::JaggedVecProxyT< PAYLOAD_T, BASE >::erase | ( | index_type | pos | ) |
Erase one item from this jagged vector element.
pos | Index within the element of the item to erase. |
void SG::detail::JaggedVecProxyT< PAYLOAD_T, BASE >::erase | ( | nonnull_iterator | first, |
nonnull_iterator | last | ||
) |
Erase a range of items from this jagged vector element.
first | Position within the element of the first item to erase. |
last | One past the position within the element of the last item to erase. |
void SG::detail::JaggedVecProxyT< PAYLOAD_T, BASE >::erase | ( | nonnull_iterator | pos | ) |
Erase one item from this jagged vector element.
pos | Position within the element of the item to erase. |
|
noexcept |
Return the first item in this element's payload.
|
noexcept |
Return a reference to the first item in this element's payload.
void SG::detail::JaggedVecProxyT< PAYLOAD_T, BASE >::insert | ( | index_type | pos, |
const Payload_t & | x | ||
) |
Insert an item into this jagged vector element.
pos | Index within the element at which to insert. |
x | The item to insert. |
void SG::detail::JaggedVecProxyT< PAYLOAD_T, BASE >::insert | ( | index_type | pos, |
ITERATOR | first, | ||
ITERATOR | last | ||
) |
Insert a range of items into this jagged vector element.
pos | Index within the element at which to insert. |
first | Start of the range to insert. |
last | End of the range to insert. |
void SG::detail::JaggedVecProxyT< PAYLOAD_T, BASE >::insert | ( | index_type | pos, |
size_t | n, | ||
const Payload_t & | x | ||
) |
Insert a number of items into this jagged vector element.
pos | Index within the element at which to insert. |
n | The number of items to insert. |
x | The value to insert. |
void SG::detail::JaggedVecProxyT< PAYLOAD_T, BASE >::insert | ( | nonnull_iterator | pos, |
const Payload_t & | x | ||
) |
Insert an item into this jagged vector element.
pos | Position within the element at which to insert. |
x | The item to insert. |
void SG::detail::JaggedVecProxyT< PAYLOAD_T, BASE >::insert | ( | nonnull_iterator | pos, |
ITERATOR | first, | ||
ITERATOR | last | ||
) |
Insert a range of items into this jagged vector element.
pos | Position within the element at which to insert. |
first | Start of the range to insert. |
last | End of the range to insert. |
void SG::detail::JaggedVecProxyT< PAYLOAD_T, BASE >::insert | ( | nonnull_iterator | pos, |
size_t | n, | ||
const Payload_t & | x | ||
) |
Insert a number of items into this jagged vector element.
pos | Position within the element at which to insert. |
n | The number of items to insert. |
x | The value to insert. |
void SG::detail::JaggedVecProxyT< PAYLOAD_T, BASE >::insert_range | ( | index_type | pos, |
const RANGE & | range | ||
) |
Insert a range of items into this jagged vector element.
pos | Index within the element at which to insert. |
range | The range to insert. |
void SG::detail::JaggedVecProxyT< PAYLOAD_T, BASE >::insert_range | ( | nonnull_iterator | pos, |
const RANGE & | range | ||
) |
Insert a range of items into this jagged vector element.
pos | Position within the element at which to insert. |
range | The range to insert. |
SG::detail::JaggedVecProxyT< PAYLOAD_T, BASE >::operator std::vector< Payload_t, VALLOC > | ( | ) | const |
Convert this jagged vector element to a vector.
JaggedVecProxyT& SG::detail::JaggedVecProxyT< PAYLOAD_T, BASE >::operator= | ( | const RANGE & | range | ) |
Assign this jagged vector element from a range.
range | The range from which to assign. |
|
noexcept |
Element access (const).
i | Index within this element's payload. |
|
noexcept |
Element access (non-const).
i | Index within this element's payload. |
void SG::detail::JaggedVecProxyT< PAYLOAD_T, BASE >::pop_back | ( | ) |
Remove the last item from this jagged vector element.
void SG::detail::JaggedVecProxyT< PAYLOAD_T, BASE >::push_back | ( | const Payload_t & | x | ) |
Add an item to the end of this jagged vector element.
x | The item to add. |
|
noexcept |
Return a (const) begin reverse iterator.
|
noexcept |
Return a (non-const) begin reverse iterator.
|
noexcept |
Return a (const) end reverse iterator.
|
noexcept |
Return a (non-const) end reverse iterator.
void SG::detail::JaggedVecProxyT< PAYLOAD_T, BASE >::resize | ( | size_t | n, |
const Payload_t & | x = Payload_t() |
||
) |
Resize this jagged vector element.
n | New size for the element. |
x | If the element is being enlarged, initialize the new elements with this value. |
|
noexcept |
Return the size of this jagged vector element.
|
private |
Index of the element we're proxying.
Definition at line 671 of file JaggedVecConversions.h.
|
private |
Reference to a span over the payload vector.
Definition at line 674 of file JaggedVecConversions.h.