fennec
Loading...
Searching...
No Matches
fennec::byte_array

container for handling byte arrays

#include <bytes.h>

Public Member Functions

constexpr byte_array ()
 Default Constructor.
 
constexpr byte_array (void *arr, size_t n)
 Buffer Constructor.
 
constexpr byte_array (const void *arr, size_t n)
 Const Buffer Constructor.
 
template<typename T , size_t n>
constexpr byte_array (T(&arr)[n])
 Buffer Constructor.
 
template<typename T , size_t n>
constexpr byte_array (const T(&arr)[n])
 Const Buffer Constructor.
 
constexpr size_t size () const
 
constexpr byte_toperator[] (int i)
 Array Access Operator.
 
constexpr byte_t operator[] (int i) const
 Const Array Access Operator.
 
template<typename T >
constexpr T * cast ()
 Cast Function.
 
template<typename T >
constexpr const T * cast () const
 Const Cast Function.
 

Constructor & Destructor Documentation

◆ byte_array() [1/4]

constexpr fennec::byte_array::byte_array ( void *  arr,
size_t  n 
)
inlineconstexpr
Parameters
arrthe buffer to wrap
nthe size of the buffer in bytes

◆ byte_array() [2/4]

constexpr fennec::byte_array::byte_array ( const void *  arr,
size_t  n 
)
inlineconstexpr
Parameters
arrthe buffer to wrap
nthe size of the buffer in bytes

◆ byte_array() [3/4]

template<typename T , size_t n>
constexpr fennec::byte_array::byte_array ( T(&)  arr[n])
inlineconstexpr
Parameters
arrthe buffer to wrap
Template Parameters
nthe size of the buffer in elements

◆ byte_array() [4/4]

template<typename T , size_t n>
constexpr fennec::byte_array::byte_array ( const T(&)  arr[n])
inlineconstexpr
Parameters
arrthe buffer to wrap
Template Parameters
nthe size of the buffer in elements

Member Function Documentation

◆ size()

constexpr size_t fennec::byte_array::size ( ) const
inlineconstexpr
Returns
The size of the array in bytes

◆ operator[]() [1/2]

constexpr byte_t & fennec::byte_array::operator[] ( int  i)
inlineconstexpr
Parameters
ithe index to access
Returns
a reference to the byte at i

◆ operator[]() [2/2]

constexpr byte_t fennec::byte_array::operator[] ( int  i) const
inlineconstexpr
Parameters
ithe index to access
Returns
a copy of the byte at i

◆ cast() [1/2]

template<typename T >
constexpr T * fennec::byte_array::cast ( )
inlineconstexpr
Template Parameters
Ttype to cast to
Returns
a pointer to the underlying buffer interpreted as an array of T

◆ cast() [2/2]

template<typename T >
constexpr const T * fennec::byte_array::cast ( ) const
inlineconstexpr
Template Parameters
Ttype to cast to
Returns
a pointer to the underlying buffer interpreted as an array of T

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