ATLAS Offline Software
Loading...
Searching...
No Matches
PhaseII::ContainerCollectionProxy< T_RawDataContainerCollection, T_RawDataProxy > Class Template Reference

Helper class to represent the top level proxy which provides per module proxy objects which provide the hit element proxies. More...

#include <PhaseIIInDetRawDataContainer.h>

Inheritance diagram for PhaseII::ContainerCollectionProxy< T_RawDataContainerCollection, T_RawDataProxy >:
Collaboration diagram for PhaseII::ContainerCollectionProxy< T_RawDataContainerCollection, T_RawDataProxy >:

Public Types

using ContainerNonConst
using value_type
using index_t
using element_index_t
using iterator
using const_iterator
using ContainerPtr = std::conditional<isConst , const ContainerNonConst *, ContainerNonConst *>::type

Public Member Functions

const index_tindex () const
 The index of this proxy container which identifies this proxy container within the parent container.
element_index_t computeChildElementIndex (const ContainerProxyAdapter< T_RawDataContainerCollection, 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 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 = std::is_const_v<Container>

Protected Member Functions

const ContainerNonConstcptr () const
ContainerNonConstptr ()

Protected Attributes

ContainerPtr m_container

Private Types

using BASE

Detailed Description

template<class T_RawDataContainerCollection, class T_RawDataProxy>
class PhaseII::ContainerCollectionProxy< T_RawDataContainerCollection, T_RawDataProxy >

Helper class to represent the top level proxy which provides per module proxy objects which provide the hit element proxies.

Definition at line 507 of file PhaseIIInDetRawDataContainer.h.

Member Typedef Documentation

◆ BASE

template<class T_RawDataContainerCollection, class T_RawDataProxy>
using PhaseII::ContainerCollectionProxy< T_RawDataContainerCollection, T_RawDataProxy >::BASE
private
Initial value:
ContainerProxy<T_RawDataContainerCollection,
Helper class to represent the top level proxy which provides per module proxy objects which provide t...
An adapter to create a container proxy from a range index which defines the actual element container ...
Helper struct to indicate the "index" of a top level container proxy.

Definition at line 511 of file PhaseIIInDetRawDataContainer.h.

◆ const_iterator

using Utils::ContainerProxy< T_RawDataContainerCollection, ContainerCollectionProxy< T_RawDataContainerCollection, T_RawDataProxy >, ContainerProxyAdapter< T_RawDataContainerCollection, T_RawDataProxy >, RootNodeIndex >::const_iterator
inherited

Definition at line 410 of file ProxyContainer.h.

◆ ContainerNonConst

using Utils::ContainerProxy< T_RawDataContainerCollection, ContainerCollectionProxy< T_RawDataContainerCollection, T_RawDataProxy >, ContainerProxyAdapter< T_RawDataContainerCollection, T_RawDataProxy >, RootNodeIndex >::ContainerNonConst
inherited

Definition at line 370 of file ProxyContainer.h.

◆ ContainerPtr

template<class Container, typename ElementIndexType>
using Utils::ContainerProxyBase< Container, ElementIndexType >::ContainerPtr = std::conditional<isConst , const ContainerNonConst *, ContainerNonConst *>::type
inherited

Definition at line 178 of file ProxyContainer.h.

◆ element_index_t

using Utils::ContainerProxy< T_RawDataContainerCollection, ContainerCollectionProxy< T_RawDataContainerCollection, T_RawDataProxy >, ContainerProxyAdapter< T_RawDataContainerCollection, T_RawDataProxy >, RootNodeIndex >::element_index_t
inherited

Definition at line 373 of file ProxyContainer.h.

◆ index_t

using Utils::ContainerProxy< T_RawDataContainerCollection, ContainerCollectionProxy< T_RawDataContainerCollection, T_RawDataProxy >, ContainerProxyAdapter< T_RawDataContainerCollection, T_RawDataProxy >, RootNodeIndex >::index_t
inherited

Definition at line 372 of file ProxyContainer.h.

◆ iterator

using Utils::ContainerProxy< T_RawDataContainerCollection, ContainerCollectionProxy< T_RawDataContainerCollection, T_RawDataProxy >, ContainerProxyAdapter< T_RawDataContainerCollection, T_RawDataProxy >, RootNodeIndex >::iterator
inherited

Definition at line 408 of file ProxyContainer.h.

◆ value_type

using Utils::ContainerProxy< T_RawDataContainerCollection, ContainerCollectionProxy< T_RawDataContainerCollection, T_RawDataProxy >, ContainerProxyAdapter< T_RawDataContainerCollection, T_RawDataProxy >, RootNodeIndex >::value_type
inherited

Definition at line 371 of file ProxyContainer.h.

Member Function Documentation

◆ back() [1/2]

auto Utils::ContainerProxy< T_RawDataContainerCollection, ContainerCollectionProxy< T_RawDataContainerCollection, T_RawDataProxy >, ContainerProxyAdapter< T_RawDataContainerCollection, T_RawDataProxy >, RootNodeIndex >::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.

◆ back() [2/2]

auto Utils::ContainerProxy< T_RawDataContainerCollection, ContainerCollectionProxy< T_RawDataContainerCollection, T_RawDataProxy >, ContainerProxyAdapter< T_RawDataContainerCollection, T_RawDataProxy >, RootNodeIndex >::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_RawDataContainerCollection, ContainerCollectionProxy< T_RawDataContainerCollection, T_RawDataProxy >, ContainerProxyAdapter< T_RawDataContainerCollection, T_RawDataProxy >, RootNodeIndex >::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, ContainerCollectionProxy< T_RawDataContainerCollection, T_RawDataProxy >, ContainerProxyAdapter< T_RawDataContainerCollection, T_RawDataProxy > > iterator

◆ begin() [2/2]

const_iterator Utils::ContainerProxy< T_RawDataContainerCollection, ContainerCollectionProxy< T_RawDataContainerCollection, T_RawDataProxy >, ContainerProxyAdapter< T_RawDataContainerCollection, T_RawDataProxy >, RootNodeIndex >::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, ContainerCollectionProxy< T_RawDataContainerCollection, T_RawDataProxy >, ContainerProxyAdapter< T_RawDataContainerCollection, T_RawDataProxy > > const_iterator

◆ beginIndex()

element_index_t Utils::ContainerProxy< T_RawDataContainerCollection, ContainerCollectionProxy< T_RawDataContainerCollection, T_RawDataProxy >, ContainerProxyAdapter< T_RawDataContainerCollection, T_RawDataProxy >, RootNodeIndex >::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_RawDataContainerCollection, ContainerCollectionProxy< T_RawDataContainerCollection, T_RawDataProxy >, ContainerProxyAdapter< T_RawDataContainerCollection, T_RawDataProxy >, RootNodeIndex >::computeChildElementIndex ( const ContainerProxyAdapter< T_RawDataContainerCollection, 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 }
const index_t & index() const
The index of this proxy container which identifies this proxy container within the parent container.

◆ computeChildElementIndex() [2/2]

element_index_t Utils::ContainerProxy< T_RawDataContainerCollection, ContainerCollectionProxy< T_RawDataContainerCollection, T_RawDataProxy >, ContainerProxyAdapter< T_RawDataContainerCollection, T_RawDataProxy >, RootNodeIndex >::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.

◆ container() [1/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.

◆ container() [2/2]

template<class Container, typename ElementIndexType>
const ContainerNonConst & Utils::ContainerProxyBase< Container, ElementIndexType >::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; }

◆ cptr()

template<class Container, typename ElementIndexType>
const ContainerNonConst * Utils::ContainerProxyBase< Container, ElementIndexType >::cptr ( ) const
inlineprotectedinherited

Definition at line 198 of file ProxyContainer.h.

198 {
199 return m_container;
200 }

◆ elementIndexAt()

element_index_t Utils::ContainerProxy< T_RawDataContainerCollection, ContainerCollectionProxy< T_RawDataContainerCollection, T_RawDataProxy >, ContainerProxyAdapter< T_RawDataContainerCollection, T_RawDataProxy >, RootNodeIndex >::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_RawDataContainerCollection, ContainerCollectionProxy< T_RawDataContainerCollection, T_RawDataProxy >, ContainerProxyAdapter< T_RawDataContainerCollection, T_RawDataProxy >, RootNodeIndex >::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_RawDataContainerCollection, ContainerCollectionProxy< T_RawDataContainerCollection, T_RawDataProxy >, ContainerProxyAdapter< T_RawDataContainerCollection, T_RawDataProxy >, RootNodeIndex >::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_RawDataContainerCollection, ContainerCollectionProxy< T_RawDataContainerCollection, T_RawDataProxy >, ContainerProxyAdapter< T_RawDataContainerCollection, T_RawDataProxy >, RootNodeIndex >::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()

element_index_t Utils::ContainerProxy< T_RawDataContainerCollection, ContainerCollectionProxy< T_RawDataContainerCollection, T_RawDataProxy >, ContainerProxyAdapter< T_RawDataContainerCollection, T_RawDataProxy >, RootNodeIndex >::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_RawDataContainerCollection, ContainerCollectionProxy< T_RawDataContainerCollection, T_RawDataProxy >, ContainerProxyAdapter< T_RawDataContainerCollection, T_RawDataProxy >, RootNodeIndex >::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.

◆ front() [2/2]

auto Utils::ContainerProxy< T_RawDataContainerCollection, ContainerCollectionProxy< T_RawDataContainerCollection, T_RawDataProxy >, ContainerProxyAdapter< T_RawDataContainerCollection, T_RawDataProxy >, RootNodeIndex >::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() );

◆ index()

const index_t & Utils::ContainerProxy< T_RawDataContainerCollection, ContainerCollectionProxy< T_RawDataContainerCollection, T_RawDataProxy >, ContainerProxyAdapter< T_RawDataContainerCollection, T_RawDataProxy >, RootNodeIndex >::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()

element_index_t Utils::ContainerProxy< T_RawDataContainerCollection, ContainerCollectionProxy< T_RawDataContainerCollection, T_RawDataProxy >, ContainerProxyAdapter< T_RawDataContainerCollection, T_RawDataProxy >, RootNodeIndex >::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_RawDataContainerCollection, ContainerCollectionProxy< T_RawDataContainerCollection, T_RawDataProxy >, ContainerProxyAdapter< T_RawDataContainerCollection, T_RawDataProxy >, RootNodeIndex >::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_RawDataContainerCollection, ContainerCollectionProxy< T_RawDataContainerCollection, T_RawDataProxy >, ContainerProxyAdapter< T_RawDataContainerCollection, T_RawDataProxy >, RootNodeIndex >::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()

template<class Container, typename ElementIndexType>
ContainerNonConst * Utils::ContainerProxyBase< Container, ElementIndexType >::ptr ( )
inlineprotectedinherited

Definition at line 201 of file ProxyContainer.h.

201 {
202 return m_container;
203 }

◆ size()

std::size_t Utils::ContainerProxy< T_RawDataContainerCollection, ContainerCollectionProxy< T_RawDataContainerCollection, T_RawDataProxy >, ContainerProxyAdapter< T_RawDataContainerCollection, T_RawDataProxy >, RootNodeIndex >::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

template<class Container, typename ElementIndexType>
bool Utils::ContainerProxyBase< Container, ElementIndexType >::isConst = std::is_const_v<Container>
staticconstexprinherited

Definition at line 175 of file ProxyContainer.h.

◆ m_container

template<class Container, typename ElementIndexType>
ContainerPtr Utils::ContainerProxyBase< Container, ElementIndexType >::m_container
protectedinherited

Definition at line 205 of file ProxyContainer.h.

◆ m_index

index_t Utils::ContainerProxy< T_RawDataContainerCollection, ContainerCollectionProxy< T_RawDataContainerCollection, T_RawDataProxy >, ContainerProxyAdapter< T_RawDataContainerCollection, T_RawDataProxy >, RootNodeIndex >::m_index
inherited

Definition at line 374 of file ProxyContainer.h.


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