CppSerdes  1.0
A serialization/deserialization library designed with embedded systems in mind
serdes::sized_pointer< void > Struct Reference

Holds a pointer to a void array (with type information stored as a runtime element size paramenter) with a constant size. More...

#include <bitcpy_sized_pointer.h>

Public Member Functions

template<typename T_array >
 sized_pointer (const sized_pointer< T_array > &other) noexcept
 Construct a new sized pointer object from another sized pointer object. More...
 
 sized_pointer (const sized_pointer< void > &other) noexcept
 Construct a new sized pointer object from a void typed sized pointer. More...
 
template<typename T >
 sized_pointer (T *const v, const size_t N) noexcept
 Construct a new sized pointer object from a raw pointer and a passed size. More...
 
template<typename T , size_t N>
 sized_pointer (T(&v)[N]) noexcept
 Construct a new sized pointer object from the array itself. More...
 
size_t bit_capacity () const noexcept
 returns the number of bits in the array
 

Public Attributes

void *const value
 the underlying pointer reinterpreted as a void* type
 
const size_t size
 size of the array (number of elements in the array)
 
const uint_fast8_t element_size
 Number of bytes per element of the original array type, same as sizeof(T_original)
 

Detailed Description

Holds a pointer to a void array (with type information stored as a runtime element size paramenter) with a constant size.

Constructor & Destructor Documentation

◆ sized_pointer() [1/4]

template<typename T_array >
serdes::sized_pointer< void >::sized_pointer ( const sized_pointer< T_array > &  other)
inlinenoexcept

Construct a new sized pointer object from another sized pointer object.

Template Parameters
T_arraythe array's base element type
Parameters
otherthe other sized_pointer to duplicate

◆ sized_pointer() [2/4]

serdes::sized_pointer< void >::sized_pointer ( const sized_pointer< void > &  other)
inlinenoexcept

Construct a new sized pointer object from a void typed sized pointer.

Parameters
otherthe other sized_pointer to duplicate

◆ sized_pointer() [3/4]

template<typename T >
serdes::sized_pointer< void >::sized_pointer ( T *const  v,
const size_t  N 
)
inlinenoexcept

Construct a new sized pointer object from a raw pointer and a passed size.

Template Parameters
Toriginal type of pointer
Parameters
vpointer to the head of the array
Nsize of the array

◆ sized_pointer() [4/4]

template<typename T , size_t N>
serdes::sized_pointer< void >::sized_pointer ( T(&)  v[N])
inlinenoexcept

Construct a new sized pointer object from the array itself.

Template Parameters
Toriginal type of pointer
Nsize of the array
Parameters
vpointer to the head of the array

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