ATLAS Offline Software
Loading...
Searching...
No Matches
Utils::ElementProxyBase< Container, ElementIndexType > Struct Template Reference

#include <ProxyContainer.h>

Inheritance diagram for Utils::ElementProxyBase< Container, ElementIndexType >:
Collaboration diagram for Utils::ElementProxyBase< Container, ElementIndexType >:

Public Types

using index_t = ElementIndexType
using ContainerNonConst = std::remove_cvref_t<Container>
using ContainerPtr = std::conditional<isConst , const ContainerNonConst *, ContainerNonConst *>::type

Public Member Functions

 ElementProxyBase (const ContainerNonConst *container, const index_t &index)
 ElementProxyBase (ContainerNonConst *container, const index_t &index)
 ElementProxyBase (const ContainerNonConst *container, index_t &&index)
 ElementProxyBase (ContainerNonConst *container, index_t &&index)
template<class OtherContainer>
requires (std::is_same_v<ContainerNonConst, typename OtherContainer::ContainerNonConst> && (!OtherContainer::isConst || isConst) )
 ElementProxyBase (const ElementProxyBase< OtherContainer, ElementIndexType > &other)
index_t index () const
const ContainerNonConstcontainer () const
ContainerNonConstcontainer ()

Static Public Attributes

static constexpr bool isConst = std::is_const_v<Container>

Protected Member Functions

const ContainerNonConstcptr () const

Protected Attributes

ContainerPtr m_container
index_t m_index

Detailed Description

template<class Container, typename ElementIndexType>
struct Utils::ElementProxyBase< Container, ElementIndexType >

Definition at line 113 of file ProxyContainer.h.

Member Typedef Documentation

◆ ContainerNonConst

template<class Container, typename ElementIndexType>
using Utils::ElementProxyBase< Container, ElementIndexType >::ContainerNonConst = std::remove_cvref_t<Container>

Definition at line 116 of file ProxyContainer.h.

◆ ContainerPtr

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

Definition at line 117 of file ProxyContainer.h.

◆ index_t

template<class Container, typename ElementIndexType>
using Utils::ElementProxyBase< Container, ElementIndexType >::index_t = ElementIndexType

Definition at line 115 of file ProxyContainer.h.

Constructor & Destructor Documentation

◆ ElementProxyBase() [1/5]

template<class Container, typename ElementIndexType>
Utils::ElementProxyBase< Container, ElementIndexType >::ElementProxyBase ( const ContainerNonConst * container,
const index_t & index )
inline

Definition at line 120 of file ProxyContainer.h.

123 {}
const ContainerNonConst & container() const

◆ ElementProxyBase() [2/5]

template<class Container, typename ElementIndexType>
Utils::ElementProxyBase< Container, ElementIndexType >::ElementProxyBase ( ContainerNonConst * container,
const index_t & index )
inline

Definition at line 124 of file ProxyContainer.h.

◆ ElementProxyBase() [3/5]

template<class Container, typename ElementIndexType>
Utils::ElementProxyBase< Container, ElementIndexType >::ElementProxyBase ( const ContainerNonConst * container,
index_t && index )
inline

Definition at line 127 of file ProxyContainer.h.

◆ ElementProxyBase() [4/5]

template<class Container, typename ElementIndexType>
Utils::ElementProxyBase< Container, ElementIndexType >::ElementProxyBase ( ContainerNonConst * container,
index_t && index )
inline

Definition at line 131 of file ProxyContainer.h.

◆ ElementProxyBase() [5/5]

template<class Container, typename ElementIndexType>
template<class OtherContainer>
requires (std::is_same_v<ContainerNonConst, typename OtherContainer::ContainerNonConst> && (!OtherContainer::isConst || isConst) )
Utils::ElementProxyBase< Container, ElementIndexType >::ElementProxyBase ( const ElementProxyBase< OtherContainer, ElementIndexType > & other)
inline

Member Function Documentation

◆ container() [1/2]

template<class Container, typename ElementIndexType>
ContainerNonConst & Utils::ElementProxyBase< Container, ElementIndexType >::container ( )
inline
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.

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

◆ container() [2/2]

template<class Container, typename ElementIndexType>
const ContainerNonConst & Utils::ElementProxyBase< Container, ElementIndexType >::container ( ) const
inline
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()

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

Definition at line 159 of file ProxyContainer.h.

159 {
160 return &container();
161 }

◆ index()

template<class Container, typename ElementIndexType>
index_t Utils::ElementProxyBase< Container, ElementIndexType >::index ( ) const
inline
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

template<class Container, typename ElementIndexType>
bool Utils::ElementProxyBase< Container, ElementIndexType >::isConst = std::is_const_v<Container>
staticconstexpr

Definition at line 114 of file ProxyContainer.h.

◆ m_container

template<class Container, typename ElementIndexType>
ContainerPtr Utils::ElementProxyBase< Container, ElementIndexType >::m_container
protected

Definition at line 162 of file ProxyContainer.h.

◆ m_index

template<class Container, typename ElementIndexType>
index_t Utils::ElementProxyBase< Container, ElementIndexType >::m_index
protected

Definition at line 163 of file ProxyContainer.h.


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