ATLAS Offline Software
Loading...
Searching...
No Matches
PhaseII::RawDataContainerProxy< T_RawDataContainer, T_RawDataProxy, accessPolicy > Class Template Reference

A proxy providing access to the RDOs of a single module. More...

#include <PhaseIIInDetRawDataContainer.h>

Inheritance diagram for PhaseII::RawDataContainerProxy< T_RawDataContainer, T_RawDataProxy, accessPolicy >:
Collaboration diagram for PhaseII::RawDataContainerProxy< T_RawDataContainer, T_RawDataProxy, accessPolicy >:

Public Types

using BASE
using value_type
using index_t
using element_index_t
using ElementProxyBase
using iterator
using const_iterator
using ContainerPtr
using ConstContainerPtr

Public Member Functions

const unsigned int & identifyHash () const
 method which returns the identifier hash of the module this proxy represents.
unsigned int beginIndex () const
unsigned int endIndex () const
const index_tindex () const
 The index of this proxy container which identifies this proxy container within the parent container.
element_index_t computeChildElementIndex (const T_RawDataProxy &element_proxy) const
 Compute the "index" of the given element which can be used to recover this element via the access operator [].
iterator begin ()
 Get the begin iterator of this proxy container for read write element access provided the access policy permits it.
iterator end ()
 Get the end iterator of this proxy container for read write element access provided the access policy permits it.
auto operator[] (std::size_t element_count) const
 Element access operator (read-only access)
auto front () const
 Get a proxy for the first child element (read-only) The operation is undefined if there are no child elements.
auto back () const
 Get a proxy for the last child element (read-only).
std::size_t size () const
 Default implementation to compute the number of elements this proxy container contains/refers to The default implementation simply computes the differences between the end index and begin index, thus the IndexType has to implement the subtraction operator.
std::size_t empty () const
 Default implementation to test whether the container does not contain elements.
const T_RawDataContainer & container () const
 return a const pointer of the container which contains the elements this proxy refers to.

Static Public Member Functions

static unsigned int beginIndex (const T_RawDataContainer *container, const IndexWithRange &range)
 method which returns the index of the first child element this proxy represents
static unsigned int endIndex (const T_RawDataContainer *container, const IndexWithRange &range)
 method which returns the index of the element after the last child element this proxy represents
static unsigned int nextElementIndex (const T_RawDataContainer *container, unsigned int element_index)
 method which returns the element which follows the element specified by element_index
static auto createElementProxy (const T_RawDataContainer *ptr, element_index_t &&element_index)
 Create a proxy for one element of the "container" this proxy represents (read-only access).
static element_index_t beginIndex (const T_RawDataContainer *container, const index_t &this_index)
 Default implementation to get the index of the first element of this proxy container For a full range container proxy e.g.
static element_index_t endIndex (const T_RawDataContainer *container, const index_t &this_index)
 Default implementation to get the index after the last element of this proxy container For a full range container proxy e.g.
static element_index_t nextElementIndex (const T_RawDataContainer *container, element_index_t &&element_index)
static element_index_t elementIndexAt (const T_RawDataContainer *container, const index_t &this_index, std::size_t element_counter)
 Default implementation to get the full index of a certain element.

Public Attributes

index_t m_index
ContainerPtrBase< accessPolicy > m_container

Detailed Description

template<class T_RawDataContainer, class T_RawDataProxy, AccessPolicy accessPolicy = AccessPolicy::ReadOnly>
class PhaseII::RawDataContainerProxy< T_RawDataContainer, T_RawDataProxy, accessPolicy >

A proxy providing access to the RDOs of a single module.

Template Parameters
T_RawDataContainerthe hit container which provides the data for the proxies.
T_RawDataProxya proxy class which provides access to the properties of a single hit and is returned for each child element this proxy provides. The proxy represents a child element range i.e. RDO range, and will provide a proxy object for each of its children.

Definition at line 350 of file PhaseIIInDetRawDataContainer.h.

Member Typedef Documentation

◆ BASE

template<class T_RawDataContainer, class T_RawDataProxy, AccessPolicy accessPolicy = AccessPolicy::ReadOnly>
using PhaseII::RawDataContainerProxy< T_RawDataContainer, T_RawDataProxy, accessPolicy >::BASE

◆ const_iterator

using Utils::ContainerProxy< T_RawDataContainer, RawDataContainerProxy< T_RawDataContainer, T_RawDataProxy, AccessPolicy::ReadOnly >, T_RawDataProxy, IndexWithRange, accessPolicy >::const_iterator
inherited

Definition at line 364 of file ProxyContainer.h.

◆ ConstContainerPtr

using Utils::ContainerProxyBase< T_RawDataContainer, T_RawDataProxy::index_t, accessPolicy >::ConstContainerPtr
inherited

Definition at line 181 of file ProxyContainer.h.

◆ ContainerPtr

using Utils::ContainerProxyBase< T_RawDataContainer, T_RawDataProxy::index_t, accessPolicy >::ContainerPtr
inherited

Definition at line 180 of file ProxyContainer.h.

◆ element_index_t

using Utils::ContainerProxy< T_RawDataContainer, RawDataContainerProxy< T_RawDataContainer, T_RawDataProxy, AccessPolicy::ReadOnly >, T_RawDataProxy, IndexWithRange, accessPolicy >::element_index_t
inherited

Definition at line 270 of file ProxyContainer.h.

◆ ElementProxyBase

using Utils::ContainerProxy< T_RawDataContainer, RawDataContainerProxy< T_RawDataContainer, T_RawDataProxy, AccessPolicy::ReadOnly >, T_RawDataProxy, IndexWithRange, accessPolicy >::ElementProxyBase
inherited

Definition at line 332 of file ProxyContainer.h.

◆ index_t

using Utils::ContainerProxy< T_RawDataContainer, RawDataContainerProxy< T_RawDataContainer, T_RawDataProxy, AccessPolicy::ReadOnly >, T_RawDataProxy, IndexWithRange, accessPolicy >::index_t
inherited

Definition at line 269 of file ProxyContainer.h.

◆ iterator

using Utils::ContainerProxy< T_RawDataContainer, RawDataContainerProxy< T_RawDataContainer, T_RawDataProxy, AccessPolicy::ReadOnly >, T_RawDataProxy, IndexWithRange, accessPolicy >::iterator
inherited

Definition at line 362 of file ProxyContainer.h.

◆ value_type

using Utils::ContainerProxy< T_RawDataContainer, RawDataContainerProxy< T_RawDataContainer, T_RawDataProxy, AccessPolicy::ReadOnly >, T_RawDataProxy, IndexWithRange, accessPolicy >::value_type
inherited

Definition at line 268 of file ProxyContainer.h.

Member Function Documentation

◆ back()

auto Utils::ContainerProxy< T_RawDataContainer, RawDataContainerProxy< T_RawDataContainer, T_RawDataProxy, AccessPolicy::ReadOnly >, T_RawDataProxy, IndexWithRange, accessPolicy >::back ( ) const
inlineinherited

Get a proxy for the last child element (read-only).

The operation is undefined if there are no child elements.

Definition at line 434 of file ProxyContainer.h.

◆ begin()

iterator Utils::ContainerProxy< T_RawDataContainer, RawDataContainerProxy< T_RawDataContainer, T_RawDataProxy, AccessPolicy::ReadOnly >, T_RawDataProxy, IndexWithRange, accessPolicy >::begin ( )
inlineinherited

Get the begin iterator of this proxy container for read write element access provided the access policy permits it.

Definition at line 391 of file ProxyContainer.h.

◆ beginIndex() [1/3]

template<class T_RawDataContainer, class T_RawDataProxy, AccessPolicy accessPolicy = AccessPolicy::ReadOnly>
unsigned int PhaseII::RawDataContainerProxy< T_RawDataContainer, T_RawDataProxy, accessPolicy >::beginIndex ( ) const
inline

◆ beginIndex() [2/3]

template<class T_RawDataContainer, class T_RawDataProxy, AccessPolicy accessPolicy = AccessPolicy::ReadOnly>
unsigned int PhaseII::RawDataContainerProxy< T_RawDataContainer, T_RawDataProxy, accessPolicy >::beginIndex ( const T_RawDataContainer * container,
const IndexWithRange & range )
inlinestatic

method which returns the index of the first child element this proxy represents

Definition at line 365 of file PhaseIIInDetRawDataContainer.h.

366 {
368 return range.beginIndex();
369 }
static unsigned int beginIndex(const T_RawDataContainer *container, const IndexWithRange &range)
method which returns the index of the first child element this proxy represents
std::size_t empty() const
Default implementation to test whether the container does not contain elements.

◆ beginIndex() [3/3]

element_index_t Utils::ContainerProxy< T_RawDataContainer, RawDataContainerProxy< T_RawDataContainer, T_RawDataProxy, AccessPolicy::ReadOnly >, T_RawDataProxy, IndexWithRange, accessPolicy >::beginIndex ( const T_RawDataContainer * container,
const index_t & this_index )
inlinestaticinherited

Default implementation to get the index of the first element of this proxy container For a full range container proxy e.g.

the root proxy container. this requires that the first element this proxy container refers to is identified by a simple integer index of 0u

Definition at line 451 of file ProxyContainer.h.

453 {
454 return static_cast<element_index_t>(0u);
455 }

◆ computeChildElementIndex()

element_index_t Utils::ContainerProxy< T_RawDataContainer, RawDataContainerProxy< T_RawDataContainer, T_RawDataProxy, AccessPolicy::ReadOnly >, T_RawDataProxy, IndexWithRange, accessPolicy >::computeChildElementIndex ( const T_RawDataProxy & element_proxy) const
inlineinherited

Compute the "index" of the given element which can be used to recover this element via the access operator [].

Definition at line 374 of file ProxyContainer.h.

377 {
379 }

◆ container()

const T_RawDataContainer & Utils::ContainerProxyBase< T_RawDataContainer, T_RawDataProxy::index_t, accessPolicy >::container ( ) const
inlineinherited

return a const pointer of the container which contains the elements this proxy refers to.

Definition at line 241 of file ProxyContainer.h.

241{ return m_container.container(); }

◆ createElementProxy()

auto Utils::ContainerProxy< T_RawDataContainer, RawDataContainerProxy< T_RawDataContainer, T_RawDataProxy, AccessPolicy::ReadOnly >, T_RawDataProxy, IndexWithRange, accessPolicy >::createElementProxy ( const T_RawDataContainer * ptr,
element_index_t && element_index )
inlinestaticinherited

Create a proxy for one element of the "container" this proxy represents (read-only access).

Parameters
ptrA pointer to the container which contains the element data
element_indexAn index which identifies the element in the given container.
Returns
A new proxy which represents the specified element.

Definition at line 308 of file ProxyContainer.h.

308 {
309 if constexpr(hasCreateProxy<ElementProxy, decltype(ptr), element_index_t> ) {
311 }
312 else {
314 }
315 }

◆ elementIndexAt()

element_index_t Utils::ContainerProxy< T_RawDataContainer, RawDataContainerProxy< T_RawDataContainer, T_RawDataProxy, AccessPolicy::ReadOnly >, T_RawDataProxy, IndexWithRange, accessPolicy >::elementIndexAt ( const T_RawDataContainer * container,
const index_t & this_index,
std::size_t element_counter )
inlinestaticinherited

Default implementation to get the full index of a certain element.

Parameters
containerThe container which contains the element data,
this_indexThe index of this proxy.
element_counterthe number of iterations from the first element to reach this element.
Returns
the full index of the specified element which fully identifies this element in the given container.

Definition at line 479 of file ProxyContainer.h.

◆ empty()

std::size_t Utils::ContainerProxy< T_RawDataContainer, RawDataContainerProxy< T_RawDataContainer, T_RawDataProxy, AccessPolicy::ReadOnly >, T_RawDataProxy, IndexWithRange, accessPolicy >::empty ( ) const
inlineinherited

Default implementation to test whether the container does not contain elements.

The default implementation simply tests whether the begin and end index are identical.

Definition at line 497 of file ProxyContainer.h.

498 {
499 return (this->m_container.cptr()
501 : true);
502 }

◆ end()

iterator Utils::ContainerProxy< T_RawDataContainer, RawDataContainerProxy< T_RawDataContainer, T_RawDataProxy, AccessPolicy::ReadOnly >, T_RawDataProxy, IndexWithRange, accessPolicy >::end ( )
inlineinherited

Get the end iterator of this proxy container for read write element access provided the access policy permits it.

Definition at line 395 of file ProxyContainer.h.

395 {
396 return iterator(this->m_container.ptr(), T_Derived::endIndex(this->m_container.cptr(), m_index) );
397 }

◆ endIndex() [1/3]

template<class T_RawDataContainer, class T_RawDataProxy, AccessPolicy accessPolicy = AccessPolicy::ReadOnly>
unsigned int PhaseII::RawDataContainerProxy< T_RawDataContainer, T_RawDataProxy, accessPolicy >::endIndex ( ) const
inline

Definition at line 387 of file PhaseIIInDetRawDataContainer.h.

387{ return this->index().endIndex(); }

◆ endIndex() [2/3]

template<class T_RawDataContainer, class T_RawDataProxy, AccessPolicy accessPolicy = AccessPolicy::ReadOnly>
unsigned int PhaseII::RawDataContainerProxy< T_RawDataContainer, T_RawDataProxy, accessPolicy >::endIndex ( const T_RawDataContainer * container,
const IndexWithRange & range )
inlinestatic

method which returns the index of the element after the last child element this proxy represents

Definition at line 371 of file PhaseIIInDetRawDataContainer.h.

371 {
373 return range.endIndex();
374 }
static unsigned int endIndex(const T_RawDataContainer *container, const IndexWithRange &range)
method which returns the index of the element after the last child element this proxy represents

◆ endIndex() [3/3]

element_index_t Utils::ContainerProxy< T_RawDataContainer, RawDataContainerProxy< T_RawDataContainer, T_RawDataProxy, AccessPolicy::ReadOnly >, T_RawDataProxy, IndexWithRange, accessPolicy >::endIndex ( const T_RawDataContainer * container,
const index_t & this_index )
inlinestaticinherited

Default implementation to get the index after the last element of this proxy container For a full range container proxy e.g.

the root proxy container. this requires that the last element this proxy container refers to is identified by a simple integer index which is provided by the size method of the container this proxy container refers to.

Definition at line 460 of file ProxyContainer.h.

462 {
464 return (container ? static_cast<element_index_t>(container->size()) : 0u);
465 }

◆ front()

auto Utils::ContainerProxy< T_RawDataContainer, RawDataContainerProxy< T_RawDataContainer, T_RawDataProxy, AccessPolicy::ReadOnly >, T_RawDataProxy, IndexWithRange, accessPolicy >::front ( ) const
inlineinherited

Get a proxy for the first child element (read-only) The operation is undefined if there are no child elements.

Definition at line 423 of file ProxyContainer.h.

424 { assert( !empty() );

◆ identifyHash()

template<class T_RawDataContainer, class T_RawDataProxy, AccessPolicy accessPolicy = AccessPolicy::ReadOnly>
const unsigned int & PhaseII::RawDataContainerProxy< T_RawDataContainer, T_RawDataProxy, accessPolicy >::identifyHash ( ) const
inline

method which returns the identifier hash of the module this proxy represents.

Definition at line 383 of file PhaseIIInDetRawDataContainer.h.

383{ return this->index().rangeIndex(); }

◆ index()

const index_t & Utils::ContainerProxy< T_RawDataContainer, RawDataContainerProxy< T_RawDataContainer, T_RawDataProxy, AccessPolicy::ReadOnly >, T_RawDataProxy, IndexWithRange, accessPolicy >::index ( ) const
inlineinherited

The index of this proxy container which identifies this proxy container within the parent container.

For the top-level proxy container the index will be the empty RootNodeIndex struct. The index is not necessarily an index that can be used as argument for the element access operator of the parent proxy to recover this proxy i.e. parent_proxy[index] is not necessarily this proxy. For the latter use computeChildElementIndex.

Definition at line 371 of file ProxyContainer.h.

371{ return m_index; }

◆ nextElementIndex() [1/2]

template<class T_RawDataContainer, class T_RawDataProxy, AccessPolicy accessPolicy = AccessPolicy::ReadOnly>
unsigned int PhaseII::RawDataContainerProxy< T_RawDataContainer, T_RawDataProxy, accessPolicy >::nextElementIndex ( const T_RawDataContainer * container,
unsigned int element_index )
inlinestatic

method which returns the element which follows the element specified by element_index

Definition at line 376 of file PhaseIIInDetRawDataContainer.h.

377 {
379 return ++element_index;
380 }

◆ nextElementIndex() [2/2]

element_index_t Utils::ContainerProxy< T_RawDataContainer, RawDataContainerProxy< T_RawDataContainer, T_RawDataProxy, AccessPolicy::ReadOnly >, T_RawDataProxy, IndexWithRange, accessPolicy >::nextElementIndex ( const T_RawDataContainer * container,
element_index_t && element_index )
inlinestaticinherited

Definition at line 468 of file ProxyContainer.h.

469 {
470 assert( container );
471 return ++element_index;
472 }

◆ operator[]()

auto Utils::ContainerProxy< T_RawDataContainer, RawDataContainerProxy< T_RawDataContainer, T_RawDataProxy, AccessPolicy::ReadOnly >, T_RawDataProxy, IndexWithRange, accessPolicy >::operator[] ( std::size_t element_count) const
inlineinherited

Element access operator (read-only access)

Parameters
element_countis the "child_index", a consecutive number which is 0 for the first element and size()-1 for the last element
Returns
Proxy representing the specified element

Definition at line 411 of file ProxyContainer.h.

◆ size()

std::size_t Utils::ContainerProxy< T_RawDataContainer, RawDataContainerProxy< T_RawDataContainer, T_RawDataProxy, AccessPolicy::ReadOnly >, T_RawDataProxy, IndexWithRange, accessPolicy >::size ( ) const
inlineinherited

Default implementation to compute the number of elements this proxy container contains/refers to The default implementation simply computes the differences between the end index and begin index, thus the IndexType has to implement the subtraction operator.

Definition at line 487 of file ProxyContainer.h.

489 {
490 return (this->m_container.cptr()
492 : 0u);
493 }

Member Data Documentation

◆ m_container

ContainerPtrBase<accessPolicy> Utils::ContainerProxyBase< T_RawDataContainer, T_RawDataProxy::index_t, accessPolicy >::m_container
inherited

Definition at line 182 of file ProxyContainer.h.

◆ m_index

index_t Utils::ContainerProxy< T_RawDataContainer, RawDataContainerProxy< T_RawDataContainer, T_RawDataProxy, AccessPolicy::ReadOnly >, T_RawDataProxy, IndexWithRange, accessPolicy >::m_index
inherited

Definition at line 271 of file ProxyContainer.h.


The documentation for this class was generated from the following file: