ATLAS Offline Software
Loading...
Searching...
No Matches
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.
size_t size () const
 Return the size of the span.
bool empty () const
 Test to see if the span is empty.
const T * data () const
 Return the start of the span.
const T & operator[] (size_t index) const
 Element access.
const T & at (size_t index) const
 Bounds-checked element access.
const T & front () const
 Return the first element in the range.
const T & back () const
 Return the last element in the range.

Private Attributes

const AuxDataSpanBasem_span
 The wrapped object.

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 190 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 197 of file AuxDataSpan.h.

198 : m_span (span) {}
Auxiliary variable span wrapper (const).
const AuxDataSpanBase & m_span
The wrapped object.

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

234 {
235 if (index >= m_span.size) {
237 }
238 return data()[index];
239 }
const T * data() const
Return the start of the span.
void throw_out_of_range(const std::string &what, size_t index, size_t size, const void *obj)
Throw an out_of_range exception.

◆ back()

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

Return the last element in the range.

Definition at line 251 of file AuxDataSpan.h.

251{ 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 216 of file AuxDataSpan.h.

216{ 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 210 of file AuxDataSpan.h.

210{ 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 245 of file AuxDataSpan.h.

245{ 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 223 of file AuxDataSpan.h.

224 {
225 return data()[index];
226 }

◆ size()

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

Return the size of the span.

Definition at line 204 of file AuxDataSpan.h.

204{ 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 256 of file AuxDataSpan.h.


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