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

An adapter to create a container proxy from a range index which defines the actual element container and the element range. More...

#include <PhaseIIInDetRawDataContainer.h>

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

Public Types

using index_t
using ContainerNonConst
using ContainerPtr

Public Member Functions

index_t index () const
const ContainerNonConstcontainer () const
ContainerNonConstcontainer ()

Static Public Member Functions

static RawDataContainerProxy< T_RawDataContainer, T_RawDataProxy > create (T_RawDataContainerCollection *container, unsigned int module_index)
 Create the actual container proxy for the elements this proxy refers to.
static RawDataContainerProxy< const T_RawDataContainer, T_RawDataProxy > create (const T_RawDataContainerCollection *container, unsigned int module_index)
 Create the actual container proxy for the elements this proxy refers to.
static unsigned int getOriginalElementIndex (const IndexWithRange &index)
 Supporting method for "converted" proxies resulting from the methods above to recover the original "child" index.

Static Public Attributes

static constexpr bool isConst

Protected Member Functions

const ContainerNonConstcptr () const

Protected Attributes

ContainerPtr m_container
index_t m_index

Private Types

using BASE = Utils::ElementProxyBase<T_RawDataContainerCollection,unsigned int >
using T_Range = typename T_RawDataContainerCollection::T_RangeTypeBase
using T_RawDataContainer = std::remove_cvref_t<decltype(std::declval<T_RawDataContainerCollection>().data(std::uint32_t{}))>

Static Private Member Functions

static IndexWithRange getIndexWithRange (const T_RawDataContainerCollection &container, unsigned int module_index)
static const T_RawDataContainergetRawDataContainer (const T_RawDataContainerCollection &container, unsigned int module_index)
static T_RawDataContainergetRawDataContainer (T_RawDataContainerCollection &container, unsigned int module_index)

Detailed Description

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

An adapter to create a container proxy from a range index which defines the actual element container and the element range.

Template Parameters
T_RawDataContainerCollectionthe hit container collection which provides the data for the hits, but also provides the container index and element ranges for a module index. it has to implement the method range(module_index), and data(container_index)
T_RawDataProxya proxy class which provides access to the properties of a single hit and is returned for each child element this proxy provides.

Definition at line 445 of file PhaseIIInDetRawDataContainer.h.

Member Typedef Documentation

◆ BASE

template<class T_RawDataContainerCollection, class T_RawDataProxy>
using PhaseII::ContainerProxyAdapter< T_RawDataContainerCollection, T_RawDataProxy >::BASE = Utils::ElementProxyBase<T_RawDataContainerCollection,unsigned int >
private

Definition at line 447 of file PhaseIIInDetRawDataContainer.h.

◆ ContainerNonConst

using Utils::ElementProxyBase< T_RawDataContainerCollection, unsigned int >::ContainerNonConst
inherited

Definition at line 116 of file ProxyContainer.h.

◆ ContainerPtr

using Utils::ElementProxyBase< T_RawDataContainerCollection, unsigned int >::ContainerPtr
inherited

Definition at line 117 of file ProxyContainer.h.

◆ index_t

using Utils::ElementProxyBase< T_RawDataContainerCollection, unsigned int >::index_t
inherited

Definition at line 115 of file ProxyContainer.h.

◆ T_Range

template<class T_RawDataContainerCollection, class T_RawDataProxy>
using PhaseII::ContainerProxyAdapter< T_RawDataContainerCollection, T_RawDataProxy >::T_Range = typename T_RawDataContainerCollection::T_RangeTypeBase
private

Definition at line 448 of file PhaseIIInDetRawDataContainer.h.

◆ T_RawDataContainer

template<class T_RawDataContainerCollection, class T_RawDataProxy>
using PhaseII::ContainerProxyAdapter< T_RawDataContainerCollection, T_RawDataProxy >::T_RawDataContainer = std::remove_cvref_t<decltype(std::declval<T_RawDataContainerCollection>().data(std::uint32_t{}))>
private

Definition at line 449 of file PhaseIIInDetRawDataContainer.h.

Member Function Documentation

◆ container() [1/2]

ContainerNonConst & Utils::ElementProxyBase< T_RawDataContainerCollection, unsigned int >::container ( )
inlineinherited
Returns
A non const pointer of the container which contains the elements this proxy refers to if the access policy permits read-write access

Definition at line 156 of file ProxyContainer.h.

◆ container() [2/2]

const ContainerNonConst & Utils::ElementProxyBase< T_RawDataContainerCollection, unsigned int >::container ( ) const
inlineinherited
Returns
A const pointer of the container which contains the elements this proxy refers to. The value returned by index identifies the element within this container.

Definition at line 152 of file ProxyContainer.h.

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

◆ cptr()

const ContainerNonConst * Utils::ElementProxyBase< T_RawDataContainerCollection, unsigned int >::cptr ( ) const
inlineprotectedinherited

Definition at line 159 of file ProxyContainer.h.

159 {
160 return &container();
161 }

◆ create() [1/2]

template<class T_RawDataContainerCollection, class T_RawDataProxy>
RawDataContainerProxy< const T_RawDataContainer, T_RawDataProxy > PhaseII::ContainerProxyAdapter< T_RawDataContainerCollection, T_RawDataProxy >::create ( const T_RawDataContainerCollection * container,
unsigned int module_index )
inlinestatic

Create the actual container proxy for the elements this proxy refers to.

This is contraction of creating this proxy and converting it into a new one. It will result in a read only proxy.

Definition at line 487 of file PhaseIIInDetRawDataContainer.h.

489 {
493 return proxy;
494 }
An adapter to create a container proxy from a range index which defines the actual element container ...
static IndexWithRange getIndexWithRange(const T_RawDataContainerCollection &container, unsigned int module_index)
static const T_RawDataContainer * getRawDataContainer(const T_RawDataContainerCollection &container, unsigned int module_index)

◆ create() [2/2]

template<class T_RawDataContainerCollection, class T_RawDataProxy>
RawDataContainerProxy< T_RawDataContainer, T_RawDataProxy > PhaseII::ContainerProxyAdapter< T_RawDataContainerCollection, T_RawDataProxy >::create ( T_RawDataContainerCollection * container,
unsigned int module_index )
inlinestatic

Create the actual container proxy for the elements this proxy refers to.

This is contraction of creating this proxy and converting it into a new one. It can result in a read/write or read only proxy.

Definition at line 475 of file PhaseIIInDetRawDataContainer.h.

◆ getIndexWithRange()

template<class T_RawDataContainerCollection, class T_RawDataProxy>
IndexWithRange PhaseII::ContainerProxyAdapter< T_RawDataContainerCollection, T_RawDataProxy >::getIndexWithRange ( const T_RawDataContainerCollection & container,
unsigned int module_index )
inlinestaticprivate

Definition at line 451 of file PhaseIIInDetRawDataContainer.h.

451 {
452 T_Range range = container.range(module_index); // container has to implement range(module_index)
453 return IndexWithRange(range.beginIndex(),
454 range.endIndex(),
456 }
typename T_RawDataContainerCollection::T_RangeTypeBase T_Range

◆ getOriginalElementIndex()

template<class T_RawDataContainerCollection, class T_RawDataProxy>
unsigned int PhaseII::ContainerProxyAdapter< T_RawDataContainerCollection, T_RawDataProxy >::getOriginalElementIndex ( const IndexWithRange & index)
inlinestatic

Supporting method for "converted" proxies resulting from the methods above to recover the original "child" index.

the original child index is the index which can be used to recover the given converted_element_proxy using the access operator [] on the parent proxy.

Definition at line 500 of file PhaseIIInDetRawDataContainer.h.

500 {
501 return index.rangeIndex();
502 }

◆ getRawDataContainer() [1/2]

template<class T_RawDataContainerCollection, class T_RawDataProxy>
const T_RawDataContainer * PhaseII::ContainerProxyAdapter< T_RawDataContainerCollection, T_RawDataProxy >::getRawDataContainer ( const T_RawDataContainerCollection & container,
unsigned int module_index )
inlinestaticprivate

Definition at line 458 of file PhaseIIInDetRawDataContainer.h.

458 {
460 return &(container.data(range.containerIndex()));
461 }

◆ getRawDataContainer() [2/2]

template<class T_RawDataContainerCollection, class T_RawDataProxy>
T_RawDataContainer * PhaseII::ContainerProxyAdapter< T_RawDataContainerCollection, T_RawDataProxy >::getRawDataContainer ( T_RawDataContainerCollection & container,
unsigned int module_index )
inlinestaticprivate

Definition at line 463 of file PhaseIIInDetRawDataContainer.h.

465 {
467 return &(container.data(range.containerIndex()));
468 }

◆ index()

index_t Utils::ElementProxyBase< T_RawDataContainerCollection, unsigned int >::index ( ) const
inlineinherited
Parameters
Returnthe "index" which identifies the element this proxy refers to within the container returned by container. This may or may not be the index which was used to create this proxy from the parent proxy i.e. in auto child_proxy=parent_proxy[index] it may be that child_proxy.index() != index. To recover "index" use auto index_recover = ParentProxy::getOriginalElementIndex(child_proxy);

Definition at line 148 of file ProxyContainer.h.

148{ return m_index; }

Member Data Documentation

◆ isConst

bool Utils::ElementProxyBase< T_RawDataContainerCollection, unsigned int >::isConst
staticconstexprinherited

Definition at line 114 of file ProxyContainer.h.

◆ m_container

ContainerPtr Utils::ElementProxyBase< T_RawDataContainerCollection, unsigned int >::m_container
protectedinherited

Definition at line 162 of file ProxyContainer.h.

◆ m_index

index_t Utils::ElementProxyBase< T_RawDataContainerCollection, unsigned int >::m_index
protectedinherited

Definition at line 163 of file ProxyContainer.h.


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