1 #ifndef ZSERIO_ENUMS_H_INC
2 #define ZSERIO_ENUMS_H_INC
17 class BitStreamReader;
18 class BitStreamWriter;
47 T
valueToEnum(
typename std::underlying_type<T>::type rawValue);
57 constexpr
typename std::underlying_type<T>::type
enumToValue(T value)
59 return static_cast<typename std::underlying_type<T>::type
>(value);
85 [itemName](
const char* enumItemName) {
return itemName.
compare(enumItemName) == 0; });
92 const size_t ordinal =
static_cast<size_t>(std::distance(
EnumTraits<T>::names.begin(), foundIt));
103 template <
typename T>
115 template <
typename PACKING_CONTEXT,
typename T>
127 template <
typename T>
140 template <
typename PACKING_CONTEXT,
typename T>
154 template <
typename T>
169 template <
typename PACKING_CONTEXT,
typename T>
179 template <
typename T>
190 template <
typename T,
typename PACKING_CONTEXT>
199 template <
typename T>
209 template <
typename PACKING_CONTEXT,
typename T>
220 template <typename T, typename std::enable_if<std::is_enum<T>::value,
int>::type = 0>
int compare(BasicStringView other) const noexcept
T read(BitStreamReader &in)
constexpr std::underlying_type< T >::type enumToValue(T value)
void write(BitStreamWriter &out, T value)
T valueToEnum(typename std::underlying_type< T >::type rawValue)
T stringToEnum(StringView itemName)
CppRuntimeException & operator<<(CppRuntimeException &exception, const BasicBitBuffer< ALLOC > &bitBuffer)
size_t enumToOrdinal(T value)
size_t initializeOffsets(size_t bitPosition, T value)
const char * enumToString(T value)
void initPackingContext(PACKING_CONTEXT &context, T value)
uint32_t enumHashCode(T value)
size_t bitSizeOf(T value)