blob: 0274320b95e1c65554c049bece3351ead91d92d8 [file] [log] [blame]
// WARNING: This file is machine generated by fidlgen.
#pragma once
#include <fidl/test.bitsconstants/cpp/common_types.h>
#include <fidl/test.bitsconstants/cpp/markers.h>
#include <lib/fidl/cpp/natural_coding_traits.h>
#include <lib/fidl/cpp/natural_types.h>
#include <cinttypes>
#include <string>
#ifdef __Fuchsia__
#endif // __Fuchsia__
namespace test_bitsconstants {
constexpr ::test_bitsconstants::BitsType kConst3 =
static_cast<::test_bitsconstants::BitsType>(131);
constexpr ::test_bitsconstants::BitsType kConst2 =
static_cast<::test_bitsconstants::BitsType>(129);
constexpr ::test_bitsconstants::BitsType kConst1 =
::test_bitsconstants::BitsType::kA;
} // namespace test_bitsconstants
namespace fidl {
template <>
struct internal::NaturalCodingTraits<
::test_bitsconstants::BitsType,
::fidl::internal::NaturalCodingConstraintEmpty> {
static constexpr size_t inline_size_v2 = sizeof(uint32_t);
static constexpr bool is_memcpy_compatible = false;
static void Encode(internal::NaturalEncoder* encoder,
::test_bitsconstants::BitsType* value, size_t offset,
size_t recursion_depth) {
if (static_cast<uint32_t>(*value) & ~131ull) {
encoder->SetError(::fidl::internal::kCodingErrorUnknownBitSetInBitsValue);
}
*encoder->template GetPtr<::test_bitsconstants::BitsType>(offset) = *value;
}
static void Decode(internal::NaturalDecoder* decoder,
::test_bitsconstants::BitsType* value, size_t offset,
size_t recursion_depth) {
*value = *decoder->template GetPtr<::test_bitsconstants::BitsType>(offset);
if (static_cast<uint32_t>(*value) & ~131ull) {
decoder->SetError(::fidl::internal::kCodingErrorUnknownBitSetInBitsValue);
}
}
};
} // namespace fidl