| // WARNING: This file is machine generated by fidlgen. |
| |
| // fidl_experiment = output_index_json |
| |
| #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> |
| #pragma clang diagnostic push |
| #pragma clang diagnostic ignored "-Wshadow" |
| |
| namespace test_structdefaultvalueenumlibraryreference { |
| |
| class Foo; |
| |
| class Foo { |
| private: |
| struct Storage_; |
| |
| public: |
| Foo(Storage_ storage) noexcept; |
| Foo(::test_dependent::MyEnum field) noexcept; |
| |
| #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& operator=(const Foo& other) noexcept; |
| |
| 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; |
| } |
| |
| // Setter for field. |
| // |
| |
| Foo& field(::test_dependent::MyEnum value); |
| |
| Foo(::fidl::internal::DefaultConstructPossiblyInvalidObjectTag); |
| |
| 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(); |
| }; |
| |
| inline Foo::Foo(Storage_ storage) noexcept : storage_(std::move(storage)) {} |
| inline Foo::Foo(::test_dependent::MyEnum field) noexcept |
| : storage_({.field = std::move(field)}) {} |
| inline Foo::Foo(const ::test_structdefaultvalueenumlibraryreference::Foo& other) noexcept : ::test_structdefaultvalueenumlibraryreference::Foo(other.CloneStorage_()) {} |
| inline Foo& ::test_structdefaultvalueenumlibraryreference::Foo::operator=(const ::test_structdefaultvalueenumlibraryreference::Foo & other) noexcept { |
| storage_ = other.CloneStorage_(); |
| return *this; |
| } |
| |
| inline Foo::Foo(::fidl::internal::DefaultConstructPossiblyInvalidObjectTag) : Foo(Storage_{ |
| .field = ::test_dependent::MyEnum::kA, |
| }) {} |
| inline Foo& Foo::field(::test_dependent::MyEnum value) { |
| storage_.field = std::move(value); |
| return *this; |
| } |
| |
| } // namespace test_structdefaultvalueenumlibraryreference |
| namespace fidl { |
| |
| template <> |
| struct IsFidlType<::test_structdefaultvalueenumlibraryreference::Foo> : public std::true_type {}; |
| |
| template <> |
| struct TypeTraits<::test_structdefaultvalueenumlibraryreference::Foo> { |
| static constexpr uint32_t kMaxNumHandles = 0; |
| static constexpr uint32_t kMaxDepth = 0; |
| static constexpr uint32_t kPrimarySize = 4; |
| static constexpr uint32_t kMaxOutOfLine = 0; |
| static constexpr bool kHasPointer = false; |
| }; |
| |
| template <> |
| struct IsStruct<::test_structdefaultvalueenumlibraryreference::Foo> : public std::true_type {}; |
| |
| template <> |
| struct internal::NaturalCodingTraits<::test_structdefaultvalueenumlibraryreference::Foo, ::fidl::internal::NaturalCodingConstraintEmpty> final |
| : public ::fidl::internal::NaturalStructCodingTraits<::test_structdefaultvalueenumlibraryreference::Foo, 4> {}; |
| |
| #pragma clang diagnostic pop |
| |
| } // namespace fidl |