ATLAS Offline Software
Loading...
Searching...
No Matches
PhaseII::RawDataContainerProxy< T_RawDataContainer, T_RawDataProxy > 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 >:
Collaboration diagram for PhaseII::RawDataContainerProxy< T_RawDataContainer, T_RawDataProxy >:

Public Types

using BASE
using ContainerNonConst
using value_type
using index_t
using element_index_t
using iterator
using const_iterator
using ContainerPtr

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 [].
element_index_t computeChildElementIndex (const T_ElementProxy &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.
const_iterator begin () const
 Get the begin iterator of this proxy container for read only element access.
iterator end ()
 Get the end iterator of this proxy container for read write element access provided the access policy permits it.
const_iterator end () const
 Get the end iterator of this proxy container for read only element access.
auto operator[] (std::size_t element_count) const
 Element access operator (read-only access)
auto operator[] (std::size_t element_count)
 Element access operator (read-write 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 front ()
 Get a proxy for the first child element (read-write).
auto back () const
 Get a proxy for the last child element (read-only).
auto back ()
 Get a proxy for the last child element (read-write).
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 ContainerNonConstcontainer () const
 return a const pointer of the container which contains the elements this proxy refers to.
ContainerNonConstcontainer ()
 Return a non const pointer of the container which contains the elements this proxy refers to provided the access policy permits read-write access.

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 element_index_t beginIndex (const ContainerNonConst *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 ContainerNonConst *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 ContainerNonConst *container, element_index_t &&element_index)
static element_index_t elementIndexAt (const ContainerNonConst *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

Static Public Attributes

static constexpr bool isConst

Protected Member Functions

const ContainerNonConstcptr () const
ContainerNonConstptr ()

Protected Attributes

ContainerPtr m_container

Detailed Description

template<class T_RawDataContainer, class T_RawDataProxy>
class PhaseII::RawDataContainerProxy< T_RawDataContainer, T_RawDataProxy >

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 386 of file PhaseIIInDetRawDataContainer.h.

Member Typedef Documentation

◆ BASE

template<class T_RawDataContainer, class T_RawDataProxy>
using PhaseII::RawDataContainerProxy< T_RawDataContainer, T_RawDataProxy >::BASE

◆ const_iterator

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

Definition at line 410 of file ProxyContainer.h.

◆ ContainerNonConst

using Utils::ContainerProxy< T_RawDataContainer, RawDataContainerProxy< T_RawDataContainer, T_RawDataProxy >, T_RawDataProxy, IndexWithRange >::ContainerNonConst
inherited

Definition at line 370 of file ProxyContainer.h.

◆ ContainerPtr

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

Definition at line 178 of file ProxyContainer.h.

◆ element_index_t

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

Definition at line 373 of file ProxyContainer.h.

◆ index_t

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

Definition at line 372 of file ProxyContainer.h.

◆ iterator

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

Definition at line 408 of file ProxyContainer.h.

◆ value_type

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

Definition at line 371 of file ProxyContainer.h.

Member Function Documentation

◆ back() [1/2]

auto Utils::ContainerProxy< T_RawDataContainer, RawDataContainerProxy< T_RawDataContainer, T_RawDataProxy >, T_RawDataProxy, IndexWithRange >::back ( )
inlineinherited

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

The operation is undefined if there are no child elements.

Definition at line 487 of file ProxyContainer.h.

488 { assert(this->size() > 0);
489 //coverity[INTEGER_OVERFLOW]
490 std::size_t element_count = this->size()-1;
492 }
The proxy container object which provides the means to iterate over its elements and create element p...
static auto createElementProxy(const BASE::ContainerNonConst *ptr, element_index_t &&element_index)

◆ back() [2/2]

auto Utils::ContainerProxy< T_RawDataContainer, RawDataContainerProxy< T_RawDataContainer, T_RawDataProxy >, T_RawDataProxy, IndexWithRange >::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 480 of file ProxyContainer.h.

◆ begin() [1/2]

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

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

Definition at line 437 of file ProxyContainer.h.

437 {
438 return iterator(this->ptr(), T_Derived::beginIndex(this->cptr(), m_index) );
439 }
ProxyIterator< ContainerNonConst, RawDataContainerProxy< T_RawDataContainer, T_RawDataProxy >, T_RawDataProxy > iterator

◆ begin() [2/2]

const_iterator Utils::ContainerProxy< T_RawDataContainer, RawDataContainerProxy< T_RawDataContainer, T_RawDataProxy >, T_RawDataProxy, IndexWithRange >::begin ( ) const
inlineinherited

Get the begin iterator of this proxy container for read only element access.

Definition at line 446 of file ProxyContainer.h.

446 {
447 return const_iterator(this->cptr(), T_Derived::beginIndex(this->cptr(), m_index) );
448 }
ProxyIterator< const ContainerNonConst, RawDataContainerProxy< T_RawDataContainer, T_RawDataProxy >, T_RawDataProxy > const_iterator

◆ beginIndex() [1/3]

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

◆ beginIndex() [2/3]

template<class T_RawDataContainer, class T_RawDataProxy>
unsigned int PhaseII::RawDataContainerProxy< T_RawDataContainer, T_RawDataProxy >::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 399 of file PhaseIIInDetRawDataContainer.h.

400 {
402 return range.beginIndex();
403 }
static unsigned int beginIndex(const T_RawDataContainer *container, const IndexWithRange &range)
method which returns the index of the first child element this proxy represents
const ContainerNonConst & container() const
return a const pointer of the container which contains the elements this proxy refers to.
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 >, T_RawDataProxy, IndexWithRange >::beginIndex ( const ContainerNonConst * 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 498 of file ProxyContainer.h.

500 {
501 return static_cast<element_index_t>(0u);
502 }

◆ computeChildElementIndex() [1/2]

element_index_t Utils::ContainerProxy< T_RawDataContainer, RawDataContainerProxy< T_RawDataContainer, T_RawDataProxy >, T_RawDataProxy, IndexWithRange >::computeChildElementIndex ( const T_ElementProxy & 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 429 of file ProxyContainer.h.

◆ computeChildElementIndex() [2/2]

element_index_t Utils::ContainerProxy< T_RawDataContainer, RawDataContainerProxy< T_RawDataContainer, T_RawDataProxy >, T_RawDataProxy, IndexWithRange >::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 420 of file ProxyContainer.h.

423 {
425 }

◆ container() [1/2]

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

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

Definition at line 190 of file ProxyContainer.h.

191 { assert(m_container != nullptr); return *m_container; }

◆ container() [2/2]

template<class Container, typename ElementIndexType>
ContainerNonConst & Utils::ContainerProxyBase< Container, ElementIndexType >::container ( )
inlineinherited

Return a non const pointer of the container which contains the elements this proxy refers to provided the access policy permits read-write access.

Definition at line 194 of file ProxyContainer.h.

195 { assert( m_container != nullptr); return *m_container; }
Base class of a container proxy.

◆ cptr()

const ContainerNonConst * Utils::ContainerProxyBase< T_RawDataContainer, T_RawDataProxy::index_t >::cptr ( ) const
inlineprotectedinherited

Definition at line 198 of file ProxyContainer.h.

198 {
199 return m_container;
200 }

◆ elementIndexAt()

element_index_t Utils::ContainerProxy< T_RawDataContainer, RawDataContainerProxy< T_RawDataContainer, T_RawDataProxy >, T_RawDataProxy, IndexWithRange >::elementIndexAt ( const ContainerNonConst * 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 526 of file ProxyContainer.h.

◆ empty()

std::size_t Utils::ContainerProxy< T_RawDataContainer, RawDataContainerProxy< T_RawDataContainer, T_RawDataProxy >, T_RawDataProxy, IndexWithRange >::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 543 of file ProxyContainer.h.

544 {
545 return (this->cptr()
547 : true);
548 }

◆ end() [1/2]

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

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

Definition at line 441 of file ProxyContainer.h.

441 {
442 return iterator(this->ptr(), T_Derived::endIndex(this->cptr(), m_index) );
443 }

◆ end() [2/2]

const_iterator Utils::ContainerProxy< T_RawDataContainer, RawDataContainerProxy< T_RawDataContainer, T_RawDataProxy >, T_RawDataProxy, IndexWithRange >::end ( ) const
inlineinherited

Get the end iterator of this proxy container for read only element access.

Definition at line 450 of file ProxyContainer.h.

450 {
451 return const_iterator(this->cptr(), T_Derived::endIndex(this->cptr(), m_index) );
452 }

◆ endIndex() [1/3]

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

Definition at line 421 of file PhaseIIInDetRawDataContainer.h.

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

◆ endIndex() [2/3]

template<class T_RawDataContainer, class T_RawDataProxy>
unsigned int PhaseII::RawDataContainerProxy< T_RawDataContainer, T_RawDataProxy >::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 405 of file PhaseIIInDetRawDataContainer.h.

405 {
407 return range.endIndex();
408 }
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 >, T_RawDataProxy, IndexWithRange >::endIndex ( const ContainerNonConst * 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 507 of file ProxyContainer.h.

509 {
511 return (container ? static_cast<element_index_t>(container->size()) : 0u);
512 }

◆ front() [1/2]

auto Utils::ContainerProxy< T_RawDataContainer, RawDataContainerProxy< T_RawDataContainer, T_RawDataProxy >, T_RawDataProxy, IndexWithRange >::front ( )
inlineinherited

Get a proxy for the first child element (read-write).

The operation is undefined if there are no child elements.

Definition at line 474 of file ProxyContainer.h.

475 { assert( !empty() );
476 return iterator::createElementProxy(this->ptr(), T_Derived::beginIndex(this->cptr(), this->m_index));}

◆ front() [2/2]

auto Utils::ContainerProxy< T_RawDataContainer, RawDataContainerProxy< T_RawDataContainer, T_RawDataProxy >, T_RawDataProxy, IndexWithRange >::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 469 of file ProxyContainer.h.

470 { assert( !empty() );

◆ identifyHash()

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

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

Definition at line 417 of file PhaseIIInDetRawDataContainer.h.

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

◆ index()

const index_t & Utils::ContainerProxy< T_RawDataContainer, RawDataContainerProxy< T_RawDataContainer, T_RawDataProxy >, T_RawDataProxy, IndexWithRange >::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 417 of file ProxyContainer.h.

417{ return m_index; }

◆ nextElementIndex() [1/2]

template<class T_RawDataContainer, class T_RawDataProxy>
unsigned int PhaseII::RawDataContainerProxy< T_RawDataContainer, T_RawDataProxy >::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 410 of file PhaseIIInDetRawDataContainer.h.

411 {
413 return ++element_index;
414 }

◆ nextElementIndex() [2/2]

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

Definition at line 515 of file ProxyContainer.h.

516 {
517 assert( container );
518 return ++element_index;
519 }

◆ operator[]() [1/2]

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

Element access operator (read-write 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 463 of file ProxyContainer.h.

◆ operator[]() [2/2]

auto Utils::ContainerProxy< T_RawDataContainer, RawDataContainerProxy< T_RawDataContainer, T_RawDataProxy >, T_RawDataProxy, IndexWithRange >::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 457 of file ProxyContainer.h.

◆ ptr()

ContainerNonConst * Utils::ContainerProxyBase< T_RawDataContainer, T_RawDataProxy::index_t >::ptr ( )
inlineprotectedinherited

Definition at line 201 of file ProxyContainer.h.

201 {
202 return m_container;
203 }

◆ size()

std::size_t Utils::ContainerProxy< T_RawDataContainer, RawDataContainerProxy< T_RawDataContainer, T_RawDataProxy >, T_RawDataProxy, IndexWithRange >::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 533 of file ProxyContainer.h.

535 {
536 return (this->cptr()
538 : 0u);
539 }

Member Data Documentation

◆ isConst

bool Utils::ContainerProxyBase< T_RawDataContainer, T_RawDataProxy::index_t >::isConst
staticconstexprinherited

Definition at line 175 of file ProxyContainer.h.

◆ m_container

ContainerPtr Utils::ContainerProxyBase< T_RawDataContainer, T_RawDataProxy::index_t >::m_container
protectedinherited

Definition at line 205 of file ProxyContainer.h.

◆ m_index

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

Definition at line 374 of file ProxyContainer.h.


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