blob: 86714bf6cfd330d3f75da6ef2cd9eb71cae8a5c2 [file] [log] [blame]
// WARNING: This file is machine generated by fidlgen.
#pragma once
#include <fidl/test.importedconstvalues/cpp/common_types.h>
#include <fidl/test.importedconstvalues/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__
#include <fidl/test.dependent/cpp/natural_types.h>
namespace test_importedconstvalues {
class MyStruct;
extern "C" const fidl_type_t test_importedconstvalues_MyStructTable;
class MyStruct {
private:
struct Storage_;
public:
MyStruct(Storage_ storage) noexcept : storage_(std::move(storage)) {}
MyStruct(uint8_t __reserved) noexcept
: storage_({.__reserved = std::move(__reserved)}) {}
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdefaulted-function-deleted"
// Default constructs a |MyStruct| only if all of its members are default
// constructible.
MyStruct() = default;
#pragma clang diagnostic pop
MyStruct(MyStruct&&) noexcept = default;
MyStruct& operator=(MyStruct&&) noexcept = default;
MyStruct(const MyStruct& other) noexcept : MyStruct(other.CloneStorage_()) {}
MyStruct& operator=(const MyStruct& other) noexcept {
storage_ = other.CloneStorage_();
return *this;
}
bool operator==(const MyStruct& other) const noexcept {
return ::fidl::internal::NaturalStructCodingTraits<
::test_importedconstvalues::MyStruct, 1>::Equal(this, &other);
}
bool operator!=(const MyStruct& other) const noexcept {
return !::fidl::internal::NaturalStructCodingTraits<
::test_importedconstvalues::MyStruct, 1>::Equal(this, &other);
}
uint8_t __reserved() const { return storage_.__reserved; }
uint8_t& __reserved() { return storage_.__reserved; }
MyStruct(::fidl::internal::DefaultConstructPossiblyInvalidObjectTag)
: MyStruct(Storage_{
.__reserved = 0u,
}) {}
private:
struct Storage_ final {
uint8_t __reserved = 0u;
};
Storage_ storage_;
Storage_ CloneStorage_() const;
friend struct ::fidl::internal::NaturalStructCodingTraits<
::test_importedconstvalues::MyStruct, 1>;
friend struct ::fidl::internal::MemberVisitor<
::test_importedconstvalues::MyStruct>;
static constexpr auto kMembers = std::make_tuple(
::fidl::internal::NaturalStructMember<
Storage_, uint8_t, fidl::internal::NaturalCodingConstraintEmpty>{
&Storage_::__reserved, 0});
static constexpr auto kPadding = std::make_tuple();
};
constexpr ::test_dependent::MyEnum kEnumMember =
::test_dependent::MyEnum::kMember;
constexpr ::test_dependent::MyBits kBitsMember =
::test_dependent::MyBits::kMember;
} // namespace test_importedconstvalues
namespace fidl {
extern "C" const fidl_type_t test_importedconstvalues_MyStructTable;
template <>
struct IsFidlType<::test_importedconstvalues::MyStruct>
: public std::true_type {};
template <>
struct ::fidl::internal::TypeTraits<::test_importedconstvalues::MyStruct>
final {
public:
static constexpr const fidl_type_t* kCodingTable =
&test_importedconstvalues_MyStructTable;
};
template <>
struct internal::NaturalCodingTraits<
::test_importedconstvalues::MyStruct,
::fidl::internal::NaturalCodingConstraintEmpty>
final : public ::fidl::internal::NaturalEmptyStructCodingTraits<
::test_importedconstvalues::MyStruct> {};
} // namespace fidl