Zserio C++ runtime library  1.1.0
Built for Zserio 2.15.0
zserio::builtin Namespace Reference

Functions

uint8_t numBits (uint64_t numValues)
 
template<typename BITMASK1 , typename BITMASK2 >
bool isSet (BITMASK1 bitmaskValue, BITMASK2 requiredMask)
 

Function Documentation

◆ isSet()

template<typename BITMASK1 , typename BITMASK2 >
bool zserio::builtin::isSet ( BITMASK1  bitmaskValue,
BITMASK2  requiredMask 
)

Checks whether the requiredMask is set within the bitmaskValue.

This method implements zserio built-in operator isset.

Parameters
bitmaskValueBitmask value to check.
requiredMaskMask to use.
Returns
True when the requiredMask is set within the bitmaskValue, false otherwise.

Definition at line 23 of file BuiltInOperators.h.

◆ numBits()

uint8_t zserio::builtin::numBits ( uint64_t  numValues)

Gets the minimum number of bits required to encode numValues different values.

This method implements Zserio built-in operator numbits.

Note: Please note that this method returns 0 if numValues is zero.

Examples: numbits(0) = 0 numbits(1) = 1 numbits(2) = 1 numbits(3) = 2 numbits(4) = 2 numbits(8) = 3 numbits(16) = 4

Parameters
numValuesThe number of different values from which to calculate number of bits.
Returns
Number of bis required to encode numValues different values.

Definition at line 9 of file BuiltInOperators.cpp.