ACTS
Experiment-independent tracking
Loading...
Searching...
No Matches
Acts::ProxyAccessorBase< T, ReadOnly > Struct Template Reference

Utility class that eases accessing dynamic columns in track and track state containers. More...

#include <Acts/EventData/ProxyAccessor.hpp>

Inheritance diagram for Acts::ProxyAccessorBase< T, ReadOnly >:
[legend]

Public Member Functions

constexpr ProxyAccessorBase (const std::string &_key)
 Create the accessor from a string key.
constexpr ProxyAccessorBase (HashedString _key)
 Create the accessor from an already-hashed string key.
template<detail::ProxyType proxy_t>
bool hasColumn (proxy_t proxy) const
 Check if the stored key exists on the proxy given as an argument.
template<detail::ProxyType proxy_t>
requires (ReadOnly)
const T & operator() (proxy_t proxy) const
 Access the stored key on the proxy given as an argument.
template<detail::MutableProxyType proxy_t>
requires (!ReadOnly)
T & operator() (proxy_t proxy) const
 Access the stored key on the proxy given as an argument.

Public Attributes

HashedString key
 Hashed string key for data access.

Detailed Description

template<typename T, bool ReadOnly>
struct Acts::ProxyAccessorBase< T, ReadOnly >

Utility class that eases accessing dynamic columns in track and track state containers.

Template Parameters
Tthe type of the value to access
ReadOnlytrue if this is a const accessor

Constructor & Destructor Documentation

◆ ProxyAccessorBase() [1/2]

template<typename T, bool ReadOnly>
Acts::ProxyAccessorBase< T, ReadOnly >::ProxyAccessorBase ( HashedString _key)
explicitconstexpr

Create the accessor from an already-hashed string key.

Parameters
_keythe key

◆ ProxyAccessorBase() [2/2]

template<typename T, bool ReadOnly>
Acts::ProxyAccessorBase< T, ReadOnly >::ProxyAccessorBase ( const std::string & _key)
explicitconstexpr

Create the accessor from a string key.

Parameters
_keythe key

Member Function Documentation

◆ hasColumn()

template<typename T, bool ReadOnly>
template<detail::ProxyType proxy_t>
bool Acts::ProxyAccessorBase< T, ReadOnly >::hasColumn ( proxy_t proxy) const

Check if the stored key exists on the proxy given as an argument.

Template Parameters
proxy_tthe type of the proxy
Parameters
proxythe proxy object to check
Returns
true if the column exists, false otherwise

◆ operator()() [1/2]

template<typename T, bool ReadOnly>
template<detail::ProxyType proxy_t>
requires (ReadOnly)
const T & Acts::ProxyAccessorBase< T, ReadOnly >::operator() ( proxy_t proxy) const

Access the stored key on the proxy given as an argument.

Const version

Template Parameters
proxy_tthe type of the track proxy
Parameters
proxythe proxy to access
Returns
const reference to the column behind the key

◆ operator()() [2/2]

template<typename T, bool ReadOnly>
template<detail::MutableProxyType proxy_t>
requires (!ReadOnly)
T & Acts::ProxyAccessorBase< T, ReadOnly >::operator() ( proxy_t proxy) const

Access the stored key on the proxy given as an argument.

Mutable version

Template Parameters
proxy_tthe type of the proxy
Parameters
proxythe proxy object to access
Returns
mutable reference to the column behind the key

Member Data Documentation

◆ key

template<typename T, bool ReadOnly>
HashedString Acts::ProxyAccessorBase< T, ReadOnly >::key

Hashed string key for data access.