Zserio C++ runtime library  1.2.0
Built for Zserio 2.16.0
zserio::DynamicBitFieldArrayTraits< T, ELEMENT_BIT_SIZE, typename std::enable_if< has_owner_type< ELEMENT_BIT_SIZE >::value >::type > Class Template Reference

#include <ArrayTraits.h>

Public Types

using ElementType = T
 
using OwnerType = typename ELEMENT_BIT_SIZE::OwnerType
 

Static Public Member Functions

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

Static Public Attributes

static constexpr bool IS_BITSIZEOF_CONSTANT = true
 

Detailed Description

template<typename T, typename ELEMENT_BIT_SIZE>
class zserio::DynamicBitFieldArrayTraits< T, ELEMENT_BIT_SIZE, typename std::enable_if< has_owner_type< ELEMENT_BIT_SIZE >::value >::type >

Array traits for dynamic bit field Zserio types with dynamic bit size (int<bitSize> or bit<bitSize>).

Specialization for dynamic bit fields which length depends on an arbitrary expression - i.e. which may need an owner.

Definition at line 298 of file ArrayTraits.h.

Member Typedef Documentation

◆ ElementType

template<typename T , typename ELEMENT_BIT_SIZE >
using zserio::DynamicBitFieldArrayTraits< T, ELEMENT_BIT_SIZE, typename std::enable_if< has_owner_type< ELEMENT_BIT_SIZE >::value >::type >::ElementType = T

Element type.

Definition at line 303 of file ArrayTraits.h.

◆ OwnerType

template<typename T , typename ELEMENT_BIT_SIZE >
using zserio::DynamicBitFieldArrayTraits< T, ELEMENT_BIT_SIZE, typename std::enable_if< has_owner_type< ELEMENT_BIT_SIZE >::value >::type >::OwnerType = typename ELEMENT_BIT_SIZE::OwnerType

Typedef for the array's owner type.

Definition at line 306 of file ArrayTraits.h.

Member Function Documentation

◆ bitSizeOf() [1/3]

template<typename T , typename ELEMENT_BIT_SIZE >
static size_t zserio::DynamicBitFieldArrayTraits< T, ELEMENT_BIT_SIZE, typename std::enable_if< has_owner_type< ELEMENT_BIT_SIZE >::value >::type >::bitSizeOf ( const OwnerType owner)
inlinestatic

Calculates bit size of the array element.

Parameters
ownerOwner of the current array.
Returns
Bit size of the array element.

Definition at line 315 of file ArrayTraits.h.

◆ bitSizeOf() [2/3]

template<typename T , typename ELEMENT_BIT_SIZE >
static size_t zserio::DynamicBitFieldArrayTraits< T, ELEMENT_BIT_SIZE, typename std::enable_if< has_owner_type< ELEMENT_BIT_SIZE >::value >::type >::bitSizeOf ( const OwnerType owner,
ElementType   
)
inlinestatic

Calculates bit size of the array element.

Parameters
ownerOwner of the current array.
Returns
Bit size of the array element.

Definition at line 327 of file ArrayTraits.h.

◆ bitSizeOf() [3/3]

template<typename T , typename ELEMENT_BIT_SIZE >
static size_t zserio::DynamicBitFieldArrayTraits< T, ELEMENT_BIT_SIZE, typename std::enable_if< has_owner_type< ELEMENT_BIT_SIZE >::value >::type >::bitSizeOf ( const OwnerType owner,
size_t  ,
ElementType   
)
inlinestatic

Calculates bit size of the array element.

Parameters
ownerOwner of the current array.
Returns
Bit size of the array element.

Definition at line 339 of file ArrayTraits.h.

◆ initializeOffsets()

template<typename T , typename ELEMENT_BIT_SIZE >
static size_t zserio::DynamicBitFieldArrayTraits< T, ELEMENT_BIT_SIZE, typename std::enable_if< has_owner_type< ELEMENT_BIT_SIZE >::value >::type >::initializeOffsets ( const OwnerType owner,
size_t  bitPosition,
ElementType   
)
inlinestatic

Initializes indexed offsets of the single array element.

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

Definition at line 352 of file ArrayTraits.h.

◆ read()

template<typename T , typename ELEMENT_BIT_SIZE >
static ElementType zserio::DynamicBitFieldArrayTraits< T, ELEMENT_BIT_SIZE, typename std::enable_if< has_owner_type< ELEMENT_BIT_SIZE >::value >::type >::read ( const OwnerType owner,
BitStreamReader in,
size_t  = 0 
)
inlinestatic

Reads the single array element.

Parameters
ownerOwner of the current array.
inBit stream reader.
Returns
Read element.

Definition at line 365 of file ArrayTraits.h.

◆ write()

template<typename T , typename ELEMENT_BIT_SIZE >
static void zserio::DynamicBitFieldArrayTraits< T, ELEMENT_BIT_SIZE, typename std::enable_if< has_owner_type< ELEMENT_BIT_SIZE >::value >::type >::write ( const OwnerType owner,
BitStreamWriter out,
ElementType  element 
)
inlinestatic

Writes the single array element.

Parameters
ownerOwner of the current array.
outBit stream writer to use.
elementElement to write.

Definition at line 377 of file ArrayTraits.h.

Member Data Documentation

◆ IS_BITSIZEOF_CONSTANT

template<typename T , typename ELEMENT_BIT_SIZE >
constexpr bool zserio::DynamicBitFieldArrayTraits< T, ELEMENT_BIT_SIZE, typename std::enable_if< has_owner_type< ELEMENT_BIT_SIZE >::value >::type >::IS_BITSIZEOF_CONSTANT = true
staticconstexpr

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

Definition at line 383 of file ArrayTraits.h.


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