ATLAS Offline Software
Public Member Functions | Private Attributes | List of all members
SG::detail::AuxDataConstSpan< T > Class Template Reference

Auxiliary variable span wrapper (const). More...

#include <AuxDataSpan.h>

Collaboration diagram for SG::detail::AuxDataConstSpan< T >:

Public Member Functions

 AuxDataConstSpan (const AuxDataSpanBase &span)
 Constructor. More...
 
size_t size () const
 Return the size of the span. More...
 
bool empty () const
 Test to see if the span is empty. More...
 
const T * data () const
 Return the start of the span. More...
 
const T & operator[] (size_t index) const
 Element access. More...
 
const T & at (size_t index) const
 Bounds-checked element access. More...
 
const T & front () const
 Return the first element in the range. More...
 
const T & back () const
 Return the last element in the range. More...
 

Private Attributes

const AuxDataSpanBasem_span
 The wrapped object. More...
 

Detailed Description

template<class T>
class SG::detail::AuxDataConstSpan< T >

Auxiliary variable span wrapper (const).

This wraps an AuxDataSpanBase for more user-friendly access. It holds the AuxDataSpanBase by reference, so it will implicity see any changes.

Definition at line 184 of file AuxDataSpan.h.

Constructor & Destructor Documentation

◆ AuxDataConstSpan()

template<class T >
SG::detail::AuxDataConstSpan< T >::AuxDataConstSpan ( const AuxDataSpanBase span)
inline

Constructor.

Parameters
spanThe base object to wrap.

Definition at line 191 of file AuxDataSpan.h.

192  : m_span (span) {}

Member Function Documentation

◆ at()

template<class T >
const T& SG::detail::AuxDataConstSpan< T >::at ( size_t  index) const
inline

Bounds-checked element access.

index The element index to access.

Definition at line 227 of file AuxDataSpan.h.

228  {
229  if (index >= m_span.size) throw std::out_of_range ("AuxDataSpan");
230  return data()[index];
231  }

◆ back()

template<class T >
const T& SG::detail::AuxDataConstSpan< T >::back ( ) const
inline

Return the last element in the range.

Definition at line 243 of file AuxDataSpan.h.

243 { return data()[m_span.size-1]; }

◆ data()

template<class T >
const T* SG::detail::AuxDataConstSpan< T >::data ( ) const
inline

Return the start of the span.

Definition at line 210 of file AuxDataSpan.h.

210 { return reinterpret_cast<const T*> (m_span.beg); }

◆ empty()

template<class T >
bool SG::detail::AuxDataConstSpan< T >::empty ( ) const
inline

Test to see if the span is empty.

Definition at line 204 of file AuxDataSpan.h.

204 { return m_span.size == 0; }

◆ front()

template<class T >
const T& SG::detail::AuxDataConstSpan< T >::front ( ) const
inline

Return the first element in the range.

Definition at line 237 of file AuxDataSpan.h.

237 { return data()[0]; }

◆ operator[]()

template<class T >
const T& SG::detail::AuxDataConstSpan< T >::operator[] ( size_t  index) const
inline

Element access.

index The element index to access.

Definition at line 217 of file AuxDataSpan.h.

218  {
219  return data()[index];
220  }

◆ size()

template<class T >
size_t SG::detail::AuxDataConstSpan< T >::size ( ) const
inline

Return the size of the span.

Definition at line 198 of file AuxDataSpan.h.

198 { return m_span.size; }

Member Data Documentation

◆ m_span

template<class T >
const AuxDataSpanBase& SG::detail::AuxDataConstSpan< T >::m_span
private

The wrapped object.

Definition at line 248 of file AuxDataSpan.h.


The documentation for this class was generated from the following file:
CxxUtils::span
span(T *ptr, std::size_t sz) -> span< T >
A couple needed deduction guides.
SG::AuxDataSpanBase::size
size_t size
The length of the variable's vector.
Definition: AuxDataSpan.h:55
index
Definition: index.py:1
SG::detail::AuxDataConstSpan::data
const T * data() const
Return the start of the span.
Definition: AuxDataSpan.h:210
SG::AuxDataSpanBase::beg
void * beg
Pointer to the start of the variable's vector.
Definition: AuxDataSpan.h:52
DeMoScan.index
string index
Definition: DeMoScan.py:364
SG::detail::AuxDataConstSpan::m_span
const AuxDataSpanBase & m_span
The wrapped object.
Definition: AuxDataSpan.h:248
TSU::T
unsigned long long T
Definition: L1TopoDataTypes.h:35