| // WARNING: This file is machine generated by fidlgen. |
| |
| #pragma once |
| |
| #include "lib/fidl/cpp/internal/natural_types_header.h" |
| |
| // |
| // Domain objects declarations (i.e. "natural types" in unified bindings). |
| // |
| namespace fidl { |
| namespace test { |
| namespace table { |
| class SimpleTable; |
| |
| class ReverseOrdinalTable; |
| |
| class OlderSimpleTable; |
| |
| class NewerSimpleTable; |
| |
| class EmptyTable; |
| |
| class SimpleTable final { |
| public: |
| static const fidl_type_t* FidlType; |
| /// Returns whether no field is set. |
| bool IsEmpty() const; |
| |
| const int64_t& x() const { |
| ZX_ASSERT(field_presence_.IsSet<0>()); |
| return x_value_.value; |
| } |
| bool has_x() const { return field_presence_.IsSet<0>(); } |
| |
| int64_t* mutable_x() { |
| if (!field_presence_.IsSet<0>()) { |
| field_presence_.Set<0>(); |
| Construct(&x_value_.value); |
| } |
| return &x_value_.value; |
| } |
| SimpleTable& set_x(int64_t _value) { |
| if (!field_presence_.IsSet<0>()) { |
| field_presence_.Set<0>(); |
| Construct(&x_value_.value, std::move(_value)); |
| } else { |
| x_value_.value = std::move(_value); |
| } |
| return *this; |
| } |
| void clear_x() { |
| if (!field_presence_.IsSet<0>()) { |
| return; |
| } |
| field_presence_.Clear<0>(); |
| Destruct(&x_value_.value); |
| } |
| |
| const int64_t& y() const { |
| ZX_ASSERT(field_presence_.IsSet<4>()); |
| return y_value_.value; |
| } |
| bool has_y() const { return field_presence_.IsSet<4>(); } |
| |
| int64_t* mutable_y() { |
| if (!field_presence_.IsSet<4>()) { |
| field_presence_.Set<4>(); |
| Construct(&y_value_.value); |
| } |
| return &y_value_.value; |
| } |
| SimpleTable& set_y(int64_t _value) { |
| if (!field_presence_.IsSet<4>()) { |
| field_presence_.Set<4>(); |
| Construct(&y_value_.value, std::move(_value)); |
| } else { |
| y_value_.value = std::move(_value); |
| } |
| return *this; |
| } |
| void clear_y() { |
| if (!field_presence_.IsSet<4>()) { |
| return; |
| } |
| field_presence_.Clear<4>(); |
| Destruct(&y_value_.value); |
| } |
| |
| const std::map<uint64_t, std::vector<uint8_t>>& UnknownData() const { |
| return _unknown_data; |
| } |
| |
| void SetUnknownDataEntry(uint32_t ordinal, std::vector<uint8_t>&& data) { |
| auto ord = static_cast<uint64_t>(ordinal); |
| ZX_ASSERT(!IsOrdinalKnown(ord)); |
| _unknown_data.insert({ord, std::move(data)}); |
| } |
| |
| SimpleTable(); |
| SimpleTable(SimpleTable&& other); |
| ~SimpleTable(); |
| SimpleTable& operator=(SimpleTable&& other); |
| |
| static inline ::std::unique_ptr<SimpleTable> New() { |
| return ::std::make_unique<SimpleTable>(); |
| } |
| |
| void Encode(::fidl::Encoder* _encoder, size_t _offset, |
| cpp17::optional<::fidl::HandleInformation> maybe_handle_info = |
| cpp17::nullopt); |
| static void Decode(::fidl::Decoder* _decoder, SimpleTable* _value, |
| size_t _offset); |
| zx_status_t Clone(SimpleTable* _result) const; |
| |
| private: |
| template <class T, class... Args> |
| void Construct(T* p, Args&&... args) { |
| new (p) T(std::forward<Args>(args)...); |
| } |
| |
| template <class T> |
| void Destruct(T* p) { |
| p->~T(); |
| } |
| |
| size_t MaxOrdinal() const { |
| size_t max_ordinal = |
| static_cast<size_t>(field_presence_.MaxSetIndex()) + std::size_t{1}; |
| for (const auto& data : _unknown_data) { |
| if (data.first > max_ordinal) { |
| max_ordinal = data.first; |
| } |
| } |
| return max_ordinal; |
| } |
| |
| static bool IsOrdinalKnown(uint64_t ordinal) { |
| switch (ordinal) { |
| case 1: |
| case 5: |
| return true; |
| default: |
| return false; |
| } |
| } |
| |
| ::fidl::internal::BitSet<5> field_presence_; |
| union ValueUnion_x { |
| ValueUnion_x() {} |
| ~ValueUnion_x() {} |
| |
| int64_t value; |
| }; |
| ValueUnion_x x_value_; |
| union ValueUnion_y { |
| ValueUnion_y() {} |
| ~ValueUnion_y() {} |
| |
| int64_t value; |
| }; |
| ValueUnion_y y_value_; |
| std::map<uint64_t, std::vector<uint8_t>> _unknown_data; |
| }; |
| |
| using SimpleTablePtr = ::std::unique_ptr<SimpleTable>; |
| |
| class ReverseOrdinalTable final { |
| public: |
| static const fidl_type_t* FidlType; |
| /// Returns whether no field is set. |
| bool IsEmpty() const; |
| |
| const int64_t& z() const { |
| ZX_ASSERT(field_presence_.IsSet<0>()); |
| return z_value_.value; |
| } |
| bool has_z() const { return field_presence_.IsSet<0>(); } |
| |
| int64_t* mutable_z() { |
| if (!field_presence_.IsSet<0>()) { |
| field_presence_.Set<0>(); |
| Construct(&z_value_.value); |
| } |
| return &z_value_.value; |
| } |
| ReverseOrdinalTable& set_z(int64_t _value) { |
| if (!field_presence_.IsSet<0>()) { |
| field_presence_.Set<0>(); |
| Construct(&z_value_.value, std::move(_value)); |
| } else { |
| z_value_.value = std::move(_value); |
| } |
| return *this; |
| } |
| void clear_z() { |
| if (!field_presence_.IsSet<0>()) { |
| return; |
| } |
| field_presence_.Clear<0>(); |
| Destruct(&z_value_.value); |
| } |
| |
| const int64_t& y() const { |
| ZX_ASSERT(field_presence_.IsSet<1>()); |
| return y_value_.value; |
| } |
| bool has_y() const { return field_presence_.IsSet<1>(); } |
| |
| int64_t* mutable_y() { |
| if (!field_presence_.IsSet<1>()) { |
| field_presence_.Set<1>(); |
| Construct(&y_value_.value); |
| } |
| return &y_value_.value; |
| } |
| ReverseOrdinalTable& set_y(int64_t _value) { |
| if (!field_presence_.IsSet<1>()) { |
| field_presence_.Set<1>(); |
| Construct(&y_value_.value, std::move(_value)); |
| } else { |
| y_value_.value = std::move(_value); |
| } |
| return *this; |
| } |
| void clear_y() { |
| if (!field_presence_.IsSet<1>()) { |
| return; |
| } |
| field_presence_.Clear<1>(); |
| Destruct(&y_value_.value); |
| } |
| |
| const int64_t& x() const { |
| ZX_ASSERT(field_presence_.IsSet<2>()); |
| return x_value_.value; |
| } |
| bool has_x() const { return field_presence_.IsSet<2>(); } |
| |
| int64_t* mutable_x() { |
| if (!field_presence_.IsSet<2>()) { |
| field_presence_.Set<2>(); |
| Construct(&x_value_.value); |
| } |
| return &x_value_.value; |
| } |
| ReverseOrdinalTable& set_x(int64_t _value) { |
| if (!field_presence_.IsSet<2>()) { |
| field_presence_.Set<2>(); |
| Construct(&x_value_.value, std::move(_value)); |
| } else { |
| x_value_.value = std::move(_value); |
| } |
| return *this; |
| } |
| void clear_x() { |
| if (!field_presence_.IsSet<2>()) { |
| return; |
| } |
| field_presence_.Clear<2>(); |
| Destruct(&x_value_.value); |
| } |
| |
| const std::map<uint64_t, std::vector<uint8_t>>& UnknownData() const { |
| return _unknown_data; |
| } |
| |
| void SetUnknownDataEntry(uint32_t ordinal, std::vector<uint8_t>&& data) { |
| auto ord = static_cast<uint64_t>(ordinal); |
| ZX_ASSERT(!IsOrdinalKnown(ord)); |
| _unknown_data.insert({ord, std::move(data)}); |
| } |
| |
| ReverseOrdinalTable(); |
| ReverseOrdinalTable(ReverseOrdinalTable&& other); |
| ~ReverseOrdinalTable(); |
| ReverseOrdinalTable& operator=(ReverseOrdinalTable&& other); |
| |
| static inline ::std::unique_ptr<ReverseOrdinalTable> New() { |
| return ::std::make_unique<ReverseOrdinalTable>(); |
| } |
| |
| void Encode(::fidl::Encoder* _encoder, size_t _offset, |
| cpp17::optional<::fidl::HandleInformation> maybe_handle_info = |
| cpp17::nullopt); |
| static void Decode(::fidl::Decoder* _decoder, ReverseOrdinalTable* _value, |
| size_t _offset); |
| zx_status_t Clone(ReverseOrdinalTable* _result) const; |
| |
| private: |
| template <class T, class... Args> |
| void Construct(T* p, Args&&... args) { |
| new (p) T(std::forward<Args>(args)...); |
| } |
| |
| template <class T> |
| void Destruct(T* p) { |
| p->~T(); |
| } |
| |
| size_t MaxOrdinal() const { |
| size_t max_ordinal = |
| static_cast<size_t>(field_presence_.MaxSetIndex()) + std::size_t{1}; |
| for (const auto& data : _unknown_data) { |
| if (data.first > max_ordinal) { |
| max_ordinal = data.first; |
| } |
| } |
| return max_ordinal; |
| } |
| |
| static bool IsOrdinalKnown(uint64_t ordinal) { |
| switch (ordinal) { |
| case 1: |
| case 2: |
| case 3: |
| return true; |
| default: |
| return false; |
| } |
| } |
| |
| ::fidl::internal::BitSet<3> field_presence_; |
| union ValueUnion_z { |
| ValueUnion_z() {} |
| ~ValueUnion_z() {} |
| |
| int64_t value; |
| }; |
| ValueUnion_z z_value_; |
| union ValueUnion_y { |
| ValueUnion_y() {} |
| ~ValueUnion_y() {} |
| |
| int64_t value; |
| }; |
| ValueUnion_y y_value_; |
| union ValueUnion_x { |
| ValueUnion_x() {} |
| ~ValueUnion_x() {} |
| |
| int64_t value; |
| }; |
| ValueUnion_x x_value_; |
| std::map<uint64_t, std::vector<uint8_t>> _unknown_data; |
| }; |
| |
| using ReverseOrdinalTablePtr = ::std::unique_ptr<ReverseOrdinalTable>; |
| |
| class OlderSimpleTable final { |
| public: |
| static const fidl_type_t* FidlType; |
| /// Returns whether no field is set. |
| bool IsEmpty() const; |
| |
| const int64_t& x() const { |
| ZX_ASSERT(field_presence_.IsSet<0>()); |
| return x_value_.value; |
| } |
| bool has_x() const { return field_presence_.IsSet<0>(); } |
| |
| int64_t* mutable_x() { |
| if (!field_presence_.IsSet<0>()) { |
| field_presence_.Set<0>(); |
| Construct(&x_value_.value); |
| } |
| return &x_value_.value; |
| } |
| OlderSimpleTable& set_x(int64_t _value) { |
| if (!field_presence_.IsSet<0>()) { |
| field_presence_.Set<0>(); |
| Construct(&x_value_.value, std::move(_value)); |
| } else { |
| x_value_.value = std::move(_value); |
| } |
| return *this; |
| } |
| void clear_x() { |
| if (!field_presence_.IsSet<0>()) { |
| return; |
| } |
| field_presence_.Clear<0>(); |
| Destruct(&x_value_.value); |
| } |
| |
| const std::map<uint64_t, std::vector<uint8_t>>& UnknownData() const { |
| return _unknown_data; |
| } |
| |
| void SetUnknownDataEntry(uint32_t ordinal, std::vector<uint8_t>&& data) { |
| auto ord = static_cast<uint64_t>(ordinal); |
| ZX_ASSERT(!IsOrdinalKnown(ord)); |
| _unknown_data.insert({ord, std::move(data)}); |
| } |
| |
| OlderSimpleTable(); |
| OlderSimpleTable(OlderSimpleTable&& other); |
| ~OlderSimpleTable(); |
| OlderSimpleTable& operator=(OlderSimpleTable&& other); |
| |
| static inline ::std::unique_ptr<OlderSimpleTable> New() { |
| return ::std::make_unique<OlderSimpleTable>(); |
| } |
| |
| void Encode(::fidl::Encoder* _encoder, size_t _offset, |
| cpp17::optional<::fidl::HandleInformation> maybe_handle_info = |
| cpp17::nullopt); |
| static void Decode(::fidl::Decoder* _decoder, OlderSimpleTable* _value, |
| size_t _offset); |
| zx_status_t Clone(OlderSimpleTable* _result) const; |
| |
| private: |
| template <class T, class... Args> |
| void Construct(T* p, Args&&... args) { |
| new (p) T(std::forward<Args>(args)...); |
| } |
| |
| template <class T> |
| void Destruct(T* p) { |
| p->~T(); |
| } |
| |
| size_t MaxOrdinal() const { |
| size_t max_ordinal = |
| static_cast<size_t>(field_presence_.MaxSetIndex()) + std::size_t{1}; |
| for (const auto& data : _unknown_data) { |
| if (data.first > max_ordinal) { |
| max_ordinal = data.first; |
| } |
| } |
| return max_ordinal; |
| } |
| |
| static bool IsOrdinalKnown(uint64_t ordinal) { |
| switch (ordinal) { |
| case 1: |
| return true; |
| default: |
| return false; |
| } |
| } |
| |
| ::fidl::internal::BitSet<1> field_presence_; |
| union ValueUnion_x { |
| ValueUnion_x() {} |
| ~ValueUnion_x() {} |
| |
| int64_t value; |
| }; |
| ValueUnion_x x_value_; |
| std::map<uint64_t, std::vector<uint8_t>> _unknown_data; |
| }; |
| |
| using OlderSimpleTablePtr = ::std::unique_ptr<OlderSimpleTable>; |
| |
| class NewerSimpleTable final { |
| public: |
| static const fidl_type_t* FidlType; |
| /// Returns whether no field is set. |
| bool IsEmpty() const; |
| |
| const int64_t& x() const { |
| ZX_ASSERT(field_presence_.IsSet<0>()); |
| return x_value_.value; |
| } |
| bool has_x() const { return field_presence_.IsSet<0>(); } |
| |
| int64_t* mutable_x() { |
| if (!field_presence_.IsSet<0>()) { |
| field_presence_.Set<0>(); |
| Construct(&x_value_.value); |
| } |
| return &x_value_.value; |
| } |
| NewerSimpleTable& set_x(int64_t _value) { |
| if (!field_presence_.IsSet<0>()) { |
| field_presence_.Set<0>(); |
| Construct(&x_value_.value, std::move(_value)); |
| } else { |
| x_value_.value = std::move(_value); |
| } |
| return *this; |
| } |
| void clear_x() { |
| if (!field_presence_.IsSet<0>()) { |
| return; |
| } |
| field_presence_.Clear<0>(); |
| Destruct(&x_value_.value); |
| } |
| |
| const int64_t& y() const { |
| ZX_ASSERT(field_presence_.IsSet<4>()); |
| return y_value_.value; |
| } |
| bool has_y() const { return field_presence_.IsSet<4>(); } |
| |
| int64_t* mutable_y() { |
| if (!field_presence_.IsSet<4>()) { |
| field_presence_.Set<4>(); |
| Construct(&y_value_.value); |
| } |
| return &y_value_.value; |
| } |
| NewerSimpleTable& set_y(int64_t _value) { |
| if (!field_presence_.IsSet<4>()) { |
| field_presence_.Set<4>(); |
| Construct(&y_value_.value, std::move(_value)); |
| } else { |
| y_value_.value = std::move(_value); |
| } |
| return *this; |
| } |
| void clear_y() { |
| if (!field_presence_.IsSet<4>()) { |
| return; |
| } |
| field_presence_.Clear<4>(); |
| Destruct(&y_value_.value); |
| } |
| |
| const int64_t& z() const { |
| ZX_ASSERT(field_presence_.IsSet<5>()); |
| return z_value_.value; |
| } |
| bool has_z() const { return field_presence_.IsSet<5>(); } |
| |
| int64_t* mutable_z() { |
| if (!field_presence_.IsSet<5>()) { |
| field_presence_.Set<5>(); |
| Construct(&z_value_.value); |
| } |
| return &z_value_.value; |
| } |
| NewerSimpleTable& set_z(int64_t _value) { |
| if (!field_presence_.IsSet<5>()) { |
| field_presence_.Set<5>(); |
| Construct(&z_value_.value, std::move(_value)); |
| } else { |
| z_value_.value = std::move(_value); |
| } |
| return *this; |
| } |
| void clear_z() { |
| if (!field_presence_.IsSet<5>()) { |
| return; |
| } |
| field_presence_.Clear<5>(); |
| Destruct(&z_value_.value); |
| } |
| |
| const std::map<uint64_t, std::vector<uint8_t>>& UnknownData() const { |
| return _unknown_data; |
| } |
| |
| void SetUnknownDataEntry(uint32_t ordinal, std::vector<uint8_t>&& data) { |
| auto ord = static_cast<uint64_t>(ordinal); |
| ZX_ASSERT(!IsOrdinalKnown(ord)); |
| _unknown_data.insert({ord, std::move(data)}); |
| } |
| |
| NewerSimpleTable(); |
| NewerSimpleTable(NewerSimpleTable&& other); |
| ~NewerSimpleTable(); |
| NewerSimpleTable& operator=(NewerSimpleTable&& other); |
| |
| static inline ::std::unique_ptr<NewerSimpleTable> New() { |
| return ::std::make_unique<NewerSimpleTable>(); |
| } |
| |
| void Encode(::fidl::Encoder* _encoder, size_t _offset, |
| cpp17::optional<::fidl::HandleInformation> maybe_handle_info = |
| cpp17::nullopt); |
| static void Decode(::fidl::Decoder* _decoder, NewerSimpleTable* _value, |
| size_t _offset); |
| zx_status_t Clone(NewerSimpleTable* _result) const; |
| |
| private: |
| template <class T, class... Args> |
| void Construct(T* p, Args&&... args) { |
| new (p) T(std::forward<Args>(args)...); |
| } |
| |
| template <class T> |
| void Destruct(T* p) { |
| p->~T(); |
| } |
| |
| size_t MaxOrdinal() const { |
| size_t max_ordinal = |
| static_cast<size_t>(field_presence_.MaxSetIndex()) + std::size_t{1}; |
| for (const auto& data : _unknown_data) { |
| if (data.first > max_ordinal) { |
| max_ordinal = data.first; |
| } |
| } |
| return max_ordinal; |
| } |
| |
| static bool IsOrdinalKnown(uint64_t ordinal) { |
| switch (ordinal) { |
| case 1: |
| case 5: |
| case 6: |
| return true; |
| default: |
| return false; |
| } |
| } |
| |
| ::fidl::internal::BitSet<6> field_presence_; |
| union ValueUnion_x { |
| ValueUnion_x() {} |
| ~ValueUnion_x() {} |
| |
| int64_t value; |
| }; |
| ValueUnion_x x_value_; |
| union ValueUnion_y { |
| ValueUnion_y() {} |
| ~ValueUnion_y() {} |
| |
| int64_t value; |
| }; |
| ValueUnion_y y_value_; |
| union ValueUnion_z { |
| ValueUnion_z() {} |
| ~ValueUnion_z() {} |
| |
| int64_t value; |
| }; |
| ValueUnion_z z_value_; |
| std::map<uint64_t, std::vector<uint8_t>> _unknown_data; |
| }; |
| |
| using NewerSimpleTablePtr = ::std::unique_ptr<NewerSimpleTable>; |
| |
| class EmptyTable final { |
| public: |
| static const fidl_type_t* FidlType; |
| /// Returns whether no field is set. |
| bool IsEmpty() const; |
| |
| const std::map<uint64_t, std::vector<uint8_t>>& UnknownData() const { |
| return _unknown_data; |
| } |
| |
| void SetUnknownDataEntry(uint32_t ordinal, std::vector<uint8_t>&& data) { |
| auto ord = static_cast<uint64_t>(ordinal); |
| ZX_ASSERT(!IsOrdinalKnown(ord)); |
| _unknown_data.insert({ord, std::move(data)}); |
| } |
| |
| EmptyTable(); |
| EmptyTable(EmptyTable&& other); |
| ~EmptyTable(); |
| EmptyTable& operator=(EmptyTable&& other); |
| |
| static inline ::std::unique_ptr<EmptyTable> New() { |
| return ::std::make_unique<EmptyTable>(); |
| } |
| |
| void Encode(::fidl::Encoder* _encoder, size_t _offset, |
| cpp17::optional<::fidl::HandleInformation> maybe_handle_info = |
| cpp17::nullopt); |
| static void Decode(::fidl::Decoder* _decoder, EmptyTable* _value, |
| size_t _offset); |
| zx_status_t Clone(EmptyTable* _result) const; |
| |
| private: |
| template <class T, class... Args> |
| void Construct(T* p, Args&&... args) { |
| new (p) T(std::forward<Args>(args)...); |
| } |
| |
| template <class T> |
| void Destruct(T* p) { |
| p->~T(); |
| } |
| |
| size_t MaxOrdinal() const { |
| size_t max_ordinal = |
| static_cast<size_t>(field_presence_.MaxSetIndex()) + std::size_t{1}; |
| for (const auto& data : _unknown_data) { |
| if (data.first > max_ordinal) { |
| max_ordinal = data.first; |
| } |
| } |
| return max_ordinal; |
| } |
| |
| static bool IsOrdinalKnown(uint64_t ordinal) { |
| switch (ordinal) { |
| return true; |
| default: |
| return false; |
| } |
| } |
| |
| ::fidl::internal::BitSet<0> field_presence_; |
| std::map<uint64_t, std::vector<uint8_t>> _unknown_data; |
| }; |
| |
| using EmptyTablePtr = ::std::unique_ptr<EmptyTable>; |
| |
| } // namespace table |
| } // namespace test |
| template <> |
| struct CodingTraits<::fidl::test::table::SimpleTable> |
| : public EncodableCodingTraits<::fidl::test::table::SimpleTable, 16> {}; |
| |
| inline zx_status_t Clone(const ::fidl::test::table::SimpleTable& _value, |
| ::fidl::test::table::SimpleTable* result) { |
| return _value.Clone(result); |
| } |
| template <> |
| struct Equality<::fidl::test::table::SimpleTable> { |
| bool operator()(const ::fidl::test::table::SimpleTable& _lhs, |
| const ::fidl::test::table::SimpleTable& _rhs) const { |
| if (_lhs.has_x()) { |
| if (!_rhs.has_x()) { |
| return false; |
| } |
| if (!::fidl::Equals(_lhs.x(), _rhs.x())) { |
| return false; |
| } |
| } else if (_rhs.has_x()) { |
| return false; |
| } |
| if (_lhs.has_y()) { |
| if (!_rhs.has_y()) { |
| return false; |
| } |
| if (!::fidl::Equals(_lhs.y(), _rhs.y())) { |
| return false; |
| } |
| } else if (_rhs.has_y()) { |
| return false; |
| } |
| return ::fidl::Equals(_lhs.UnknownData(), _rhs.UnknownData()); |
| } |
| }; |
| template <> |
| struct CodingTraits<::fidl::test::table::ReverseOrdinalTable> |
| : public EncodableCodingTraits<::fidl::test::table::ReverseOrdinalTable, |
| 16> {}; |
| |
| inline zx_status_t Clone(const ::fidl::test::table::ReverseOrdinalTable& _value, |
| ::fidl::test::table::ReverseOrdinalTable* result) { |
| return _value.Clone(result); |
| } |
| template <> |
| struct Equality<::fidl::test::table::ReverseOrdinalTable> { |
| bool operator()(const ::fidl::test::table::ReverseOrdinalTable& _lhs, |
| const ::fidl::test::table::ReverseOrdinalTable& _rhs) const { |
| if (_lhs.has_z()) { |
| if (!_rhs.has_z()) { |
| return false; |
| } |
| if (!::fidl::Equals(_lhs.z(), _rhs.z())) { |
| return false; |
| } |
| } else if (_rhs.has_z()) { |
| return false; |
| } |
| if (_lhs.has_y()) { |
| if (!_rhs.has_y()) { |
| return false; |
| } |
| if (!::fidl::Equals(_lhs.y(), _rhs.y())) { |
| return false; |
| } |
| } else if (_rhs.has_y()) { |
| return false; |
| } |
| if (_lhs.has_x()) { |
| if (!_rhs.has_x()) { |
| return false; |
| } |
| if (!::fidl::Equals(_lhs.x(), _rhs.x())) { |
| return false; |
| } |
| } else if (_rhs.has_x()) { |
| return false; |
| } |
| return ::fidl::Equals(_lhs.UnknownData(), _rhs.UnknownData()); |
| } |
| }; |
| template <> |
| struct CodingTraits<::fidl::test::table::OlderSimpleTable> |
| : public EncodableCodingTraits<::fidl::test::table::OlderSimpleTable, 16> { |
| }; |
| |
| inline zx_status_t Clone(const ::fidl::test::table::OlderSimpleTable& _value, |
| ::fidl::test::table::OlderSimpleTable* result) { |
| return _value.Clone(result); |
| } |
| template <> |
| struct Equality<::fidl::test::table::OlderSimpleTable> { |
| bool operator()(const ::fidl::test::table::OlderSimpleTable& _lhs, |
| const ::fidl::test::table::OlderSimpleTable& _rhs) const { |
| if (_lhs.has_x()) { |
| if (!_rhs.has_x()) { |
| return false; |
| } |
| if (!::fidl::Equals(_lhs.x(), _rhs.x())) { |
| return false; |
| } |
| } else if (_rhs.has_x()) { |
| return false; |
| } |
| return ::fidl::Equals(_lhs.UnknownData(), _rhs.UnknownData()); |
| } |
| }; |
| template <> |
| struct CodingTraits<::fidl::test::table::NewerSimpleTable> |
| : public EncodableCodingTraits<::fidl::test::table::NewerSimpleTable, 16> { |
| }; |
| |
| inline zx_status_t Clone(const ::fidl::test::table::NewerSimpleTable& _value, |
| ::fidl::test::table::NewerSimpleTable* result) { |
| return _value.Clone(result); |
| } |
| template <> |
| struct Equality<::fidl::test::table::NewerSimpleTable> { |
| bool operator()(const ::fidl::test::table::NewerSimpleTable& _lhs, |
| const ::fidl::test::table::NewerSimpleTable& _rhs) const { |
| if (_lhs.has_x()) { |
| if (!_rhs.has_x()) { |
| return false; |
| } |
| if (!::fidl::Equals(_lhs.x(), _rhs.x())) { |
| return false; |
| } |
| } else if (_rhs.has_x()) { |
| return false; |
| } |
| if (_lhs.has_y()) { |
| if (!_rhs.has_y()) { |
| return false; |
| } |
| if (!::fidl::Equals(_lhs.y(), _rhs.y())) { |
| return false; |
| } |
| } else if (_rhs.has_y()) { |
| return false; |
| } |
| if (_lhs.has_z()) { |
| if (!_rhs.has_z()) { |
| return false; |
| } |
| if (!::fidl::Equals(_lhs.z(), _rhs.z())) { |
| return false; |
| } |
| } else if (_rhs.has_z()) { |
| return false; |
| } |
| return ::fidl::Equals(_lhs.UnknownData(), _rhs.UnknownData()); |
| } |
| }; |
| template <> |
| struct CodingTraits<::fidl::test::table::EmptyTable> |
| : public EncodableCodingTraits<::fidl::test::table::EmptyTable, 16> {}; |
| |
| inline zx_status_t Clone(const ::fidl::test::table::EmptyTable& _value, |
| ::fidl::test::table::EmptyTable* result) { |
| return _value.Clone(result); |
| } |
| template <> |
| struct Equality<::fidl::test::table::EmptyTable> { |
| bool operator()(const ::fidl::test::table::EmptyTable& _lhs, |
| const ::fidl::test::table::EmptyTable& _rhs) const { |
| return ::fidl::Equals(_lhs.UnknownData(), _rhs.UnknownData()); |
| } |
| }; |
| |
| } // namespace fidl |