Base Framework
Public Member Functions | List of all members
ConstSpan< TYPE > Class Template Reference

#include <base/mem/Span.h>

Public Member Functions

 ConstSpan () noexcept
 
 ConstSpan (const TYPE *_buffer, MemorySize _size) noexcept
 
 ConstSpan (const TYPE *_buffer, const TYPE *end) noexcept
 
 ConstSpan (const Span< TYPE > &span) noexcept
 
const TYPE * begin () const noexcept
 
const TYPE * end () const noexcept
 
const TYPE * cbegin () const noexcept
 
const TYPE * cend () const noexcept
 
MemorySize getSize () const noexcept
 
const TYPE & operator[] (MemorySize index) const noexcept
 
 operator bool () const noexcept
 

Detailed Description

template<class TYPE>
class ConstSpan< TYPE >

Sequence of values in memory. The memory is not owned by class. You must ensure that the memory is not released.

Constructor & Destructor Documentation

◆ ConstSpan() [1/4]

template<class TYPE >
ConstSpan< TYPE >::ConstSpan ( )
inlinenoexcept

Initializes empty span.

◆ ConstSpan() [2/4]

template<class TYPE >
ConstSpan< TYPE >::ConstSpan ( const TYPE *  _buffer,
MemorySize  _size 
)
inlinenoexcept

Initializes span.

◆ ConstSpan() [3/4]

template<class TYPE >
ConstSpan< TYPE >::ConstSpan ( const TYPE *  _buffer,
const TYPE *  end 
)
inlinenoexcept

Initializes span.

◆ ConstSpan() [4/4]

template<class TYPE >
ConstSpan< TYPE >::ConstSpan ( const Span< TYPE > &  span)
inlinenoexcept

Initializes span.

Member Function Documentation

◆ begin()

template<class TYPE >
const TYPE* ConstSpan< TYPE >::begin ( ) const
inlinenoexcept

Begin iterator.

◆ cbegin()

template<class TYPE >
const TYPE* ConstSpan< TYPE >::cbegin ( ) const
inlinenoexcept

Begin iterator.

◆ cend()

template<class TYPE >
const TYPE* ConstSpan< TYPE >::cend ( ) const
inlinenoexcept

End iterator.

◆ end()

template<class TYPE >
const TYPE* ConstSpan< TYPE >::end ( ) const
inlinenoexcept

End iterator.

◆ getSize()

template<class TYPE >
MemorySize ConstSpan< TYPE >::getSize ( ) const
inlinenoexcept

Returns the size.

◆ operator bool()

template<class TYPE >
ConstSpan< TYPE >::operator bool ( ) const
inlinenoexcept

Returns true if non-empty.

◆ operator[]()

template<class TYPE >
const TYPE& ConstSpan< TYPE >::operator[] ( MemorySize  index) const
inlinenoexcept

Returns the item at the given index.