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 185 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 192 of file AuxDataSpan.h.

193  : 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 228 of file AuxDataSpan.h.

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

◆ back()

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

Return the last element in the range.

Definition at line 244 of file AuxDataSpan.h.

244 { 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 211 of file AuxDataSpan.h.

211 { 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 205 of file AuxDataSpan.h.

205 { 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 238 of file AuxDataSpan.h.

238 { 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 218 of file AuxDataSpan.h.

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

◆ size()

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

Return the size of the span.

Definition at line 199 of file AuxDataSpan.h.

199 { 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 249 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:56
index
Definition: index.py:1
SG::detail::AuxDataConstSpan::data
const T * data() const
Return the start of the span.
Definition: AuxDataSpan.h:211
SG::AuxDataSpanBase::beg
void * beg
Pointer to the start of the variable's vector.
Definition: AuxDataSpan.h:53
DeMoScan.index
string index
Definition: DeMoScan.py:364
SG::detail::AuxDataConstSpan::m_span
const AuxDataSpanBase & m_span
The wrapped object.
Definition: AuxDataSpan.h:249
TSU::T
unsigned long long T
Definition: L1TopoDataTypes.h:35