ATLAS Offline Software
Public Types | Public Member Functions | Private Attributes | List of all members
SG::detail::ELSpanProxy< CONT, PLINK_ALLOC > Class Template Reference

Proxy for a span of ElementLinks. More...

#include <ELProxy.h>

Inheritance diagram for SG::detail::ELSpanProxy< CONT, PLINK_ALLOC >:
Collaboration diagram for SG::detail::ELSpanProxy< CONT, PLINK_ALLOC >:

Public Types

using Base = ELSpanProxyBase< CONT, PLINK_ALLOC >
 Base class of this one, holding the actual span. More...
 
using PLink_t = SG::PackedLink< CONT >
 The PackedLink class we proxy. More...
 
using Link_t = ElementLink< CONT >
 The ElementLink class we resolve to. More...
 
using PackedLink_span = detail::PackedLink_span< CONT, PLINK_ALLOC >
 A span over PackedLink. More...
 
using VElt_t = std::vector< SG::PackedLink< CONT >, PLINK_ALLOC >
 The vector of @PackedLink that we proxy. More...
 
using iterator = std::ranges::iterator_t< Base >
 Iterator type for this range. More...
 

Public Member Functions

 ELSpanProxy (VElt_t &velt, AuxVectorData &container, SG::auxid_t auxid, SG::auxid_t linked_auxid)
 Constructor. More...
 
template<ElementLinkRange< CONT > RANGE>
void operator= (const RANGE &r)
 Assign from a range of ElementLink. More...
 
template<class VALLOC >
 operator std::vector< Link_t, VALLOC > () const
 Convert to a vector of ElementLink. More...
 
std::vector< Link_tasVector () const
 Convert to a vector of ElementLink. More...
 
template<class VALLOC >
bool operator== (const std::vector< Link_t, VALLOC > &v) const
 Equality testing. More...
 
void push_back (const Link_t &l)
 Add a new link to this vector of links. More...
 
void clear ()
 Clear this vector of links. More...
 
void resize (size_t n, const Link_t &l=Link_t())
 Resize this vector of links. More...
 
void erase (iterator pos)
 Erase one element from this vector of links. More...
 
void erase (iterator first, iterator last)
 Erase a range of elements from this vector of links. More...
 
void insert (iterator pos, const Link_t &l)
 Insert a new link into this vector of links. More...
 
void insert (iterator pos, size_t n, const Link_t &l)
 Insert copies of a new link into this vector of links. More...
 
template<CxxUtils::detail::InputValIterator< ElementLink< CONT > > ITERATOR>
void insert (iterator pos, ITERATOR first, ITERATOR last)
 Insert a range of links into this vector of links. More...
 
template<ElementLinkRange< CONT > RANGE>
void insert_range (iterator pos, const RANGE &range)
 Insert a range of links into this vector of links. More...
 
template<ElementLinkRange< CONT > RANGE>
void append_range (const RANGE &range)
 Append a range of links to the end of this vector of links. More...
 
void pop_back ()
 Remove the last element in this vector of links. More...
 
void assign (size_t n, const Link_t &l)
 Set this vector of links to copies of a new link. More...
 
template<CxxUtils::detail::InputValIterator< ElementLink< CONT > > ITERATOR>
void assign (ITERATOR first, ITERATOR last)
 Set this vector of links to a range of links. More...
 
template<ElementLinkRange< CONT > RANGE>
void assign_range (const RANGE &range)
 Set this vector of links to a range of links. More...
 
decltype(auto) at (size_t i)
 
decltype(auto) at (size_t i) const
 

Private Attributes

VElt_tm_velt
 The vector of PackedLink that we proxy. More...
 
ELProxyInSpanConverter< CONT > m_cnv
 The converter to use for the span. More...
 

Detailed Description

template<class CONT, class PLINK_ALLOC>
class SG::detail::ELSpanProxy< CONT, PLINK_ALLOC >

Proxy for a span of ElementLinks.

This class proxies a vector of PackedLink. It acts as a span which returns ElementLink proxies, allowing the span elements to be read and written as ElementLink.

We also allow assignment from a range of ElementLink and conversion to a vector of ElementLink.

The proxies we return will reference the needed PackedLinkConverter by reference. The actual instance is stored by value in this class.

Here, CONT is the type of the storable container that we reference, and PLINK_ALLOC is the allocator type for the vector over PackedLinks.

Definition at line 329 of file ELProxy.h.

Member Typedef Documentation

◆ Base

template<class CONT , class PLINK_ALLOC >
using SG::detail::ELSpanProxy< CONT, PLINK_ALLOC >::Base = ELSpanProxyBase<CONT, PLINK_ALLOC>

Base class of this one, holding the actual span.

Definition at line 334 of file ELProxy.h.

◆ iterator

template<class CONT , class PLINK_ALLOC >
using SG::detail::ELSpanProxy< CONT, PLINK_ALLOC >::iterator = std::ranges::iterator_t<Base>

Iterator type for this range.

Definition at line 349 of file ELProxy.h.

◆ Link_t

template<class CONT , class PLINK_ALLOC >
using SG::detail::ELSpanProxy< CONT, PLINK_ALLOC >::Link_t = ElementLink<CONT>

The ElementLink class we resolve to.

Definition at line 340 of file ELProxy.h.

◆ PackedLink_span

template<class CONT , class PLINK_ALLOC >
using SG::detail::ELSpanProxy< CONT, PLINK_ALLOC >::PackedLink_span = detail::PackedLink_span<CONT, PLINK_ALLOC>

A span over PackedLink.

Definition at line 343 of file ELProxy.h.

◆ PLink_t

template<class CONT , class PLINK_ALLOC >
using SG::detail::ELSpanProxy< CONT, PLINK_ALLOC >::PLink_t = SG::PackedLink<CONT>

The PackedLink class we proxy.

Definition at line 337 of file ELProxy.h.

◆ VElt_t

template<class CONT , class PLINK_ALLOC >
using SG::detail::ELSpanProxy< CONT, PLINK_ALLOC >::VElt_t = std::vector<SG::PackedLink<CONT>, PLINK_ALLOC>

The vector of @PackedLink that we proxy.

Definition at line 346 of file ELProxy.h.

Constructor & Destructor Documentation

◆ ELSpanProxy()

template<class CONT , class PLINK_ALLOC >
SG::detail::ELSpanProxy< CONT, PLINK_ALLOC >::ELSpanProxy ( VElt_t velt,
AuxVectorData container,
SG::auxid_t  auxid,
SG::auxid_t  linked_auxid 
)

Constructor.

Parameters
veltThe vector of PackedLink that we proxy. @proxy container Container holding the variables.
auxidThe ID of the PackedLink variable.
linked_auxidThe ID of the linked DataLinks.

Member Function Documentation

◆ append_range()

template<class CONT , class PLINK_ALLOC >
template<ElementLinkRange< CONT > RANGE>
void SG::detail::ELSpanProxy< CONT, PLINK_ALLOC >::append_range ( const RANGE &  range)

Append a range of links to the end of this vector of links.

Parameters
rangeThe range to append.

◆ assign() [1/2]

template<class CONT , class PLINK_ALLOC >
template<CxxUtils::detail::InputValIterator< ElementLink< CONT > > ITERATOR>
void SG::detail::ELSpanProxy< CONT, PLINK_ALLOC >::assign ( ITERATOR  first,
ITERATOR  last 
)

Set this vector of links to a range of links.

Parameters
firstThe first element to copy.
lastOne past the last element to copy.

◆ assign() [2/2]

template<class CONT , class PLINK_ALLOC >
void SG::detail::ELSpanProxy< CONT, PLINK_ALLOC >::assign ( size_t  n,
const Link_t l 
)

Set this vector of links to copies of a new link.

Parameters
nNumber of copies to insert.
lThe link(s) to insert.

◆ assign_range()

template<class CONT , class PLINK_ALLOC >
template<ElementLinkRange< CONT > RANGE>
void SG::detail::ELSpanProxy< CONT, PLINK_ALLOC >::assign_range ( const RANGE &  range)

Set this vector of links to a range of links.

Parameters
rangeThe range of links to copy.
lastOne past the last element to copy.

◆ asVector()

template<class CONT , class PLINK_ALLOC >
std::vector<Link_t> SG::detail::ELSpanProxy< CONT, PLINK_ALLOC >::asVector ( ) const

Convert to a vector of ElementLink.

◆ at() [1/2]

template<class RANGE >
decltype(auto) CxxUtils::range_with_at< RANGE >::at ( size_t  i)
inlineinherited

Definition at line 38 of file range_with_at.h.

39  {
40  if (i >= std::size(*this))
41  throw std::out_of_range ("CxxUtils::range_with_at");
42  return this->operator[] (i);
43  }

◆ at() [2/2]

template<class RANGE >
decltype(auto) CxxUtils::range_with_at< RANGE >::at ( size_t  i) const
inlineinherited

Definition at line 46 of file range_with_at.h.

47  {
48  if (i >= std::size(*this))
49  throw std::out_of_range ("CxxUtils::range_with_at");
50  return this->operator[] (i);
51  }

◆ clear()

template<class CONT , class PLINK_ALLOC >
void SG::detail::ELSpanProxy< CONT, PLINK_ALLOC >::clear ( )

Clear this vector of links.

◆ erase() [1/2]

template<class CONT , class PLINK_ALLOC >
void SG::detail::ELSpanProxy< CONT, PLINK_ALLOC >::erase ( iterator  first,
iterator  last 
)

Erase a range of elements from this vector of links.

Parameters
firstThe first element to erase.
lastOne past the last element to erase.
posThe element to erase.

◆ erase() [2/2]

template<class CONT , class PLINK_ALLOC >
void SG::detail::ELSpanProxy< CONT, PLINK_ALLOC >::erase ( iterator  pos)

Erase one element from this vector of links.

Parameters
posThe element to erase.

◆ insert() [1/3]

template<class CONT , class PLINK_ALLOC >
void SG::detail::ELSpanProxy< CONT, PLINK_ALLOC >::insert ( iterator  pos,
const Link_t l 
)

Insert a new link into this vector of links.

Parameters
posThe position at which to insert the link.
lThe link to insert.

◆ insert() [2/3]

template<class CONT , class PLINK_ALLOC >
template<CxxUtils::detail::InputValIterator< ElementLink< CONT > > ITERATOR>
void SG::detail::ELSpanProxy< CONT, PLINK_ALLOC >::insert ( iterator  pos,
ITERATOR  first,
ITERATOR  last 
)

Insert a range of links into this vector of links.

Parameters
posThe position at which to insert the links.
firstThe first element to insert.
lastOne past the last element to insert.

◆ insert() [3/3]

template<class CONT , class PLINK_ALLOC >
void SG::detail::ELSpanProxy< CONT, PLINK_ALLOC >::insert ( iterator  pos,
size_t  n,
const Link_t l 
)

Insert copies of a new link into this vector of links.

Parameters
posThe position at which to insert the link.
nNumber of copies to insert.
lThe link(s) to insert.

◆ insert_range()

template<class CONT , class PLINK_ALLOC >
template<ElementLinkRange< CONT > RANGE>
void SG::detail::ELSpanProxy< CONT, PLINK_ALLOC >::insert_range ( iterator  pos,
const RANGE &  range 
)

Insert a range of links into this vector of links.

Parameters
posThe position at which to insert the links.
rangeThe range to insert.

◆ operator std::vector< Link_t, VALLOC >()

template<class CONT , class PLINK_ALLOC >
template<class VALLOC >
SG::detail::ELSpanProxy< CONT, PLINK_ALLOC >::operator std::vector< Link_t, VALLOC > ( ) const

Convert to a vector of ElementLink.

◆ operator=()

template<class CONT , class PLINK_ALLOC >
template<ElementLinkRange< CONT > RANGE>
void SG::detail::ELSpanProxy< CONT, PLINK_ALLOC >::operator= ( const RANGE &  r)

Assign from a range of ElementLink.

Parameters
rThe range from which to assign.

◆ operator==()

template<class CONT , class PLINK_ALLOC >
template<class VALLOC >
bool SG::detail::ELSpanProxy< CONT, PLINK_ALLOC >::operator== ( const std::vector< Link_t, VALLOC > &  v) const

Equality testing.

◆ pop_back()

template<class CONT , class PLINK_ALLOC >
void SG::detail::ELSpanProxy< CONT, PLINK_ALLOC >::pop_back ( )

Remove the last element in this vector of links.

◆ push_back()

template<class CONT , class PLINK_ALLOC >
void SG::detail::ELSpanProxy< CONT, PLINK_ALLOC >::push_back ( const Link_t l)

Add a new link to this vector of links.

Parameters
lThe new link to add.

◆ resize()

template<class CONT , class PLINK_ALLOC >
void SG::detail::ELSpanProxy< CONT, PLINK_ALLOC >::resize ( size_t  n,
const Link_t l = Link_t() 
)

Resize this vector of links.

Parameters
nThe desired new size.
lValue with which to fill any new elements.

Member Data Documentation

◆ m_cnv

template<class CONT , class PLINK_ALLOC >
ELProxyInSpanConverter<CONT> SG::detail::ELSpanProxy< CONT, PLINK_ALLOC >::m_cnv
private

The converter to use for the span.

Definition at line 510 of file ELProxy.h.

◆ m_velt

template<class CONT , class PLINK_ALLOC >
VElt_t& SG::detail::ELSpanProxy< CONT, PLINK_ALLOC >::m_velt
private

The vector of PackedLink that we proxy.

Definition at line 507 of file ELProxy.h.


The documentation for this class was generated from the following file:
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
lumiFormat.i
int i
Definition: lumiFormat.py:85