Zserio C++17 runtime library
0.5.0
Built for Zserio 2.17.0
BitPositionUtil.h
Go to the documentation of this file.
1
#ifndef ZSERIO_BITPOSITION_UTIL_H_INC
2
#define ZSERIO_BITPOSITION_UTIL_H_INC
3
4
#include <cstddef>
5
6
#include "
zserio/BitSize.h
"
7
8
namespace
zserio
9
{
10
19
inline
constexpr
BitSize
alignTo
(
BitSize
alignmentValue,
BitSize
bitPosition)
20
{
21
return
(bitPosition > 0 && alignmentValue != 0)
22
? (((bitPosition - 1) / alignmentValue) + 1) * alignmentValue
23
: bitPosition;
24
}
25
26
}
// namespace zserio
27
28
#endif
// ifndef ZSERIO_BITPOSITION_UTIL_H_INC
BitSize.h
zserio
Definition:
AllocatorHolder.h:8
zserio::BitSize
unsigned int BitSize
Definition:
BitSize.h:8
zserio::alignTo
constexpr BitSize alignTo(BitSize alignmentValue, BitSize bitPosition)
Definition:
BitPositionUtil.h:19
zserio
BitPositionUtil.h
Generated by
1.9.1