blob: 62d2c6cc37104ea61437cdd60c4ee331eb04c42f [file] [log] [blame]
// WARNING: This file is machine generated by fidlgen.
#pragma once
#include <fidl/test.structdefaultvalueenumlibraryreference/cpp/common_types.h>
#include <fidl/test.structdefaultvalueenumlibraryreference/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_structdefaultvalueenumlibraryreference {
class Foo;
extern "C" const fidl_type_t
test_structdefaultvalueenumlibraryreference_FooTable;
class Foo {
private:
struct Storage_;
public:
Foo(Storage_ storage) noexcept : storage_(std::move(storage)) {}
Foo(::test_dependent::MyEnum field) noexcept
: storage_({.field = std::move(field)}) {}
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdefaulted-function-deleted"
// Default constructs a |Foo| only if all of its members are default
// constructible.
Foo() = default;
#pragma clang diagnostic pop
Foo(Foo&&) noexcept = default;
Foo& operator=(Foo&&) noexcept = default;
Foo(const Foo& other) noexcept : Foo(other.CloneStorage_()) {}
Foo& operator=(const Foo& other) noexcept {
storage_ = other.CloneStorage_();
return *this;
}
bool operator==(const Foo& other) const noexcept {
return ::fidl::internal::NaturalStructCodingTraits<
::test_structdefaultvalueenumlibraryreference::Foo, 4>::Equal(this,
&other);
}
bool operator!=(const Foo& other) const noexcept {
return !::fidl::internal::NaturalStructCodingTraits<
::test_structdefaultvalueenumlibraryreference::Foo, 4>::Equal(this,
&other);
}
::test_dependent::MyEnum field() const { return storage_.field; }
::test_dependent::MyEnum& field() { return storage_.field; }
Foo(::fidl::internal::DefaultConstructPossiblyInvalidObjectTag)
: Foo(Storage_{
.field = ::test_dependent::MyEnum::kA,
}) {}
private:
struct Storage_ final {
::test_dependent::MyEnum field = ::test_dependent::MyEnum::kA;
};
Storage_ storage_;
Storage_ CloneStorage_() const;
friend struct ::fidl::internal::NaturalStructCodingTraits<
::test_structdefaultvalueenumlibraryreference::Foo, 4>;
friend struct ::fidl::internal::MemberVisitor<
::test_structdefaultvalueenumlibraryreference::Foo>;
static constexpr auto kMembers = std::make_tuple(
::fidl::internal::NaturalStructMember<
Storage_, ::test_dependent::MyEnum,
fidl::internal::NaturalCodingConstraintEmpty>{&Storage_::field, 0});
static constexpr auto kPadding = std::make_tuple();
};
} // namespace test_structdefaultvalueenumlibraryreference
namespace fidl {
extern "C" const fidl_type_t
test_structdefaultvalueenumlibraryreference_FooTable;
template <>
struct IsFidlType<::test_structdefaultvalueenumlibraryreference::Foo>
: public std::true_type {};
template <>
struct ::fidl::internal::TypeTraits<
::test_structdefaultvalueenumlibraryreference::Foo>
final {
public:
static constexpr const fidl_type_t* kCodingTable =
&test_structdefaultvalueenumlibraryreference_FooTable;
};
template <>
struct internal::NaturalCodingTraits<
::test_structdefaultvalueenumlibraryreference::Foo,
::fidl::internal::NaturalCodingConstraintEmpty>
final : public ::fidl::internal::NaturalStructCodingTraits<
::test_structdefaultvalueenumlibraryreference::Foo, 4> {};
} // namespace fidl