Zserio C++ runtime library  1.1.0
Built for Zserio 2.15.0
zserio::BitFieldArrayTraits< T, NUM_BITS > Class Template Reference

#include <ArrayTraits.h>

Public Types

using ElementType = T
 

Static Public Member Functions

static size_t bitSizeOf ()
 
static size_t bitSizeOf (ElementType)
 
static size_t bitSizeOf (size_t, ElementType)
 
static size_t initializeOffsets (size_t bitPosition, ElementType)
 
static ElementType read (BitStreamReader &in, size_t=0)
 
static void write (BitStreamWriter &out, ElementType element)
 

Static Public Attributes

static constexpr bool IS_BITSIZEOF_CONSTANT = true
 

Detailed Description

template<typename T, uint8_t NUM_BITS>
class zserio::BitFieldArrayTraits< T, NUM_BITS >

Array traits for bit field Zserio types.

These traits are used for all fixed bit fields (int:N or bit:N) or for dynamic bit fields which have constant bit size available during generation (int<N> or bit<N>).

Definition at line 134 of file ArrayTraits.h.

Member Typedef Documentation

◆ ElementType

template<typename T , uint8_t NUM_BITS>
using zserio::BitFieldArrayTraits< T, NUM_BITS >::ElementType = T

Element type.

Definition at line 138 of file ArrayTraits.h.

Member Function Documentation

◆ bitSizeOf() [1/3]

template<typename T , uint8_t NUM_BITS>
static size_t zserio::BitFieldArrayTraits< T, NUM_BITS >::bitSizeOf ( )
inlinestatic

Calculates bit size of the array element.

Returns
Bit size of the array element.

Definition at line 145 of file ArrayTraits.h.

◆ bitSizeOf() [2/3]

template<typename T , uint8_t NUM_BITS>
static size_t zserio::BitFieldArrayTraits< T, NUM_BITS >::bitSizeOf ( ElementType  )
inlinestatic

Calculates bit size of the array element.

Returns
Bit size of the array element.

Definition at line 155 of file ArrayTraits.h.

◆ bitSizeOf() [3/3]

template<typename T , uint8_t NUM_BITS>
static size_t zserio::BitFieldArrayTraits< T, NUM_BITS >::bitSizeOf ( size_t  ,
ElementType   
)
inlinestatic

Calculates bit size of the array element.

Returns
Bit size of the array element.

Definition at line 165 of file ArrayTraits.h.

◆ initializeOffsets()

template<typename T , uint8_t NUM_BITS>
static size_t zserio::BitFieldArrayTraits< T, NUM_BITS >::initializeOffsets ( size_t  bitPosition,
ElementType   
)
inlinestatic

Initializes indexed offsets of the single array element.

Parameters
bitPositionCurrent bit position.
Returns
Updated bit position which points to the first bit after the array element.

Definition at line 177 of file ArrayTraits.h.

◆ read()

template<typename T , uint8_t NUM_BITS>
static ElementType zserio::BitFieldArrayTraits< T, NUM_BITS >::read ( BitStreamReader in,
size_t  = 0 
)
inlinestatic

Reads the single array element.

Parameters
inBit stream reader.
Returns
Read element.

Definition at line 189 of file ArrayTraits.h.

◆ write()

template<typename T , uint8_t NUM_BITS>
static void zserio::BitFieldArrayTraits< T, NUM_BITS >::write ( BitStreamWriter out,
ElementType  element 
)
inlinestatic

Writes the single array element.

Parameters
outBit stream writer to use.
elementElement to write.

Definition at line 200 of file ArrayTraits.h.

Member Data Documentation

◆ IS_BITSIZEOF_CONSTANT

template<typename T , uint8_t NUM_BITS>
constexpr bool zserio::BitFieldArrayTraits< T, NUM_BITS >::IS_BITSIZEOF_CONSTANT = true
staticconstexpr

Determines whether the bit size of the single element is constant.

Definition at line 206 of file ArrayTraits.h.


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