| /** |
| * Generated by the Emboss compiler. DO NOT EDIT! |
| */ |
| #ifndef TESTDATA_TEXT_FORMAT_EMB_H_ |
| #define TESTDATA_TEXT_FORMAT_EMB_H_ |
| #include <stdint.h> |
| #include <string.h> |
| |
| #include <algorithm> |
| #include <type_traits> |
| #include <utility> |
| |
| #include "runtime/cpp/emboss_cpp_util.h" |
| |
| #include "runtime/cpp/emboss_prelude.h" |
| |
| #include "runtime/cpp/emboss_enum_view.h" |
| |
| #include "runtime/cpp/emboss_text_util.h" |
| |
| |
| |
| /* NOLINTBEGIN */ |
| namespace emboss { |
| namespace test { |
| namespace Vanilla { |
| |
| } // namespace Vanilla |
| |
| |
| template <class Storage> |
| class GenericVanillaView; |
| |
| namespace StructWithSkippedFields { |
| |
| } // namespace StructWithSkippedFields |
| |
| |
| template <class Storage> |
| class GenericStructWithSkippedFieldsView; |
| |
| namespace StructWithSkippedStructureFields { |
| |
| } // namespace StructWithSkippedStructureFields |
| |
| |
| template <class Storage> |
| class GenericStructWithSkippedStructureFieldsView; |
| |
| |
| |
| |
| |
| |
| namespace Vanilla { |
| |
| } // namespace Vanilla |
| |
| |
| template <class View> |
| struct EmbossReservedInternalIsGenericVanillaView; |
| |
| template <class Storage> |
| class GenericVanillaView final { |
| public: |
| GenericVanillaView() : backing_() {} |
| explicit GenericVanillaView( |
| Storage emboss_reserved_local_bytes) |
| : backing_(emboss_reserved_local_bytes) |
| {} |
| |
| template <typename OtherStorage> |
| GenericVanillaView( |
| const GenericVanillaView<OtherStorage> &emboss_reserved_local_other) |
| : backing_{emboss_reserved_local_other.BackingStorage()} |
| {} |
| |
| template <typename Arg, |
| typename = typename ::std::enable_if< |
| !EmbossReservedInternalIsGenericVanillaView< |
| typename ::std::remove_cv<typename ::std::remove_reference< |
| Arg>::type>::type>::value>::type> |
| explicit GenericVanillaView( |
| Arg &&emboss_reserved_local_arg) |
| : backing_(::std::forward<Arg>( |
| emboss_reserved_local_arg)) |
| {} |
| template <typename Arg0, typename Arg1, typename... Args> |
| explicit GenericVanillaView( |
| Arg0 &&emboss_reserved_local_arg0, |
| Arg1 &&emboss_reserved_local_arg1, Args &&... emboss_reserved_local_args) |
| : backing_(::std::forward<Arg0>(emboss_reserved_local_arg0), |
| ::std::forward<Arg1>(emboss_reserved_local_arg1), |
| ::std::forward<Args>( |
| emboss_reserved_local_args)...) |
| {} |
| |
| template <typename OtherStorage> |
| GenericVanillaView<Storage> &operator=( |
| const GenericVanillaView<OtherStorage> &emboss_reserved_local_other) { |
| backing_ = emboss_reserved_local_other.BackingStorage(); |
| return *this; |
| } |
| |
| |
| |
| bool Ok() const { |
| if (!IsComplete()) return false; |
| |
| if (!has_a().Known()) return false; |
| if (has_a().ValueOrDefault() && !a().Ok()) return false; |
| |
| |
| if (!has_b().Known()) return false; |
| if (has_b().ValueOrDefault() && !b().Ok()) return false; |
| |
| |
| if (!has_IntrinsicSizeInBytes().Known()) return false; |
| if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; |
| |
| |
| if (!has_MaxSizeInBytes().Known()) return false; |
| if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; |
| |
| |
| if (!has_MinSizeInBytes().Known()) return false; |
| if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().Ok()) return false; |
| |
| |
| |
| return true; |
| } |
| Storage BackingStorage() const { return backing_; } |
| bool IsComplete() const { |
| return backing_.Ok() && IntrinsicSizeInBytes().Ok() && |
| backing_.SizeInBytes() >= |
| static_cast</**/ ::std::size_t>( |
| IntrinsicSizeInBytes().UncheckedRead()); |
| } |
| static constexpr ::std::size_t SizeInBytes() { |
| return static_cast</**/ ::std::size_t>(IntrinsicSizeInBytes().Read()); |
| } |
| static constexpr bool SizeIsKnown() { |
| return IntrinsicSizeInBytes().Ok(); |
| } |
| |
| |
| template <typename OtherStorage> |
| bool Equals( |
| GenericVanillaView<OtherStorage> emboss_reserved_local_other) const { |
| |
| if (!has_a().Known()) return false; |
| if (!emboss_reserved_local_other.has_a().Known()) return false; |
| |
| if (emboss_reserved_local_other.has_a().ValueOrDefault() && |
| !has_a().ValueOrDefault()) |
| return false; |
| if (has_a().ValueOrDefault() && |
| !emboss_reserved_local_other.has_a().ValueOrDefault()) |
| return false; |
| |
| if (emboss_reserved_local_other.has_a().ValueOrDefault() && |
| has_a().ValueOrDefault() && |
| !a().Equals(emboss_reserved_local_other.a())) |
| return false; |
| |
| |
| |
| if (!has_b().Known()) return false; |
| if (!emboss_reserved_local_other.has_b().Known()) return false; |
| |
| if (emboss_reserved_local_other.has_b().ValueOrDefault() && |
| !has_b().ValueOrDefault()) |
| return false; |
| if (has_b().ValueOrDefault() && |
| !emboss_reserved_local_other.has_b().ValueOrDefault()) |
| return false; |
| |
| if (emboss_reserved_local_other.has_b().ValueOrDefault() && |
| has_b().ValueOrDefault() && |
| !b().Equals(emboss_reserved_local_other.b())) |
| return false; |
| |
| return true; |
| } |
| template <typename OtherStorage> |
| bool UncheckedEquals( |
| GenericVanillaView<OtherStorage> emboss_reserved_local_other) const { |
| |
| if (emboss_reserved_local_other.has_a().ValueOr(false) && |
| !has_a().ValueOr(false)) |
| return false; |
| if (has_a().ValueOr(false) && |
| !emboss_reserved_local_other.has_a().ValueOr(false)) |
| return false; |
| |
| if (emboss_reserved_local_other.has_a().ValueOr(false) && |
| has_a().ValueOr(false) && |
| !a().UncheckedEquals(emboss_reserved_local_other.a())) |
| return false; |
| |
| |
| |
| if (emboss_reserved_local_other.has_b().ValueOr(false) && |
| !has_b().ValueOr(false)) |
| return false; |
| if (has_b().ValueOr(false) && |
| !emboss_reserved_local_other.has_b().ValueOr(false)) |
| return false; |
| |
| if (emboss_reserved_local_other.has_b().ValueOr(false) && |
| has_b().ValueOr(false) && |
| !b().UncheckedEquals(emboss_reserved_local_other.b())) |
| return false; |
| |
| return true; |
| } |
| template <typename OtherStorage> |
| void UncheckedCopyFrom( |
| GenericVanillaView<OtherStorage> emboss_reserved_local_other) const { |
| backing_.UncheckedCopyFrom( |
| emboss_reserved_local_other.BackingStorage(), |
| emboss_reserved_local_other.IntrinsicSizeInBytes().UncheckedRead()); |
| } |
| |
| template <typename OtherStorage> |
| void CopyFrom( |
| GenericVanillaView<OtherStorage> emboss_reserved_local_other) const { |
| backing_.CopyFrom( |
| emboss_reserved_local_other.BackingStorage(), |
| emboss_reserved_local_other.IntrinsicSizeInBytes().Read()); |
| } |
| template <typename OtherStorage> |
| bool TryToCopyFrom( |
| GenericVanillaView<OtherStorage> emboss_reserved_local_other) const { |
| return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( |
| emboss_reserved_local_other.BackingStorage(), |
| emboss_reserved_local_other.IntrinsicSizeInBytes().Read()); |
| } |
| |
| template <class Stream> |
| bool UpdateFromTextStream(Stream *emboss_reserved_local_stream) const { |
| ::std::string emboss_reserved_local_brace; |
| if (!::emboss::support::ReadToken(emboss_reserved_local_stream, |
| &emboss_reserved_local_brace)) |
| return false; |
| if (emboss_reserved_local_brace != "{") return false; |
| for (;;) { |
| ::std::string emboss_reserved_local_name; |
| if (!::emboss::support::ReadToken(emboss_reserved_local_stream, |
| &emboss_reserved_local_name)) |
| return false; |
| if (emboss_reserved_local_name == ",") |
| if (!::emboss::support::ReadToken(emboss_reserved_local_stream, |
| &emboss_reserved_local_name)) |
| return false; |
| if (emboss_reserved_local_name == "}") return true; |
| ::std::string emboss_reserved_local_colon; |
| if (!::emboss::support::ReadToken(emboss_reserved_local_stream, |
| &emboss_reserved_local_colon)) |
| return false; |
| if (emboss_reserved_local_colon != ":") return false; |
| if (emboss_reserved_local_name == "a") { |
| if (!a().UpdateFromTextStream( |
| emboss_reserved_local_stream)) { |
| return false; |
| } |
| continue; |
| } |
| |
| if (emboss_reserved_local_name == "b") { |
| if (!b().UpdateFromTextStream( |
| emboss_reserved_local_stream)) { |
| return false; |
| } |
| continue; |
| } |
| |
| return false; |
| } |
| } |
| |
| template <class Stream> |
| void WriteToTextStream( |
| Stream *emboss_reserved_local_stream, |
| ::emboss::TextOutputOptions emboss_reserved_local_options) const { |
| ::emboss::TextOutputOptions emboss_reserved_local_field_options = |
| emboss_reserved_local_options.PlusOneIndent(); |
| if (emboss_reserved_local_options.multiline()) { |
| emboss_reserved_local_stream->Write("{\n"); |
| } else { |
| emboss_reserved_local_stream->Write("{"); |
| } |
| bool emboss_reserved_local_wrote_field = false; |
| if (has_a().ValueOr(false)) { |
| if (!emboss_reserved_local_field_options.allow_partial_output() || |
| a().IsAggregate() || a().Ok()) { |
| if (emboss_reserved_local_field_options.multiline()) { |
| emboss_reserved_local_stream->Write( |
| emboss_reserved_local_field_options.current_indent()); |
| } else { |
| if (emboss_reserved_local_wrote_field) { |
| emboss_reserved_local_stream->Write(","); |
| } |
| emboss_reserved_local_stream->Write(" "); |
| } |
| emboss_reserved_local_stream->Write("a: "); |
| a().WriteToTextStream(emboss_reserved_local_stream, |
| emboss_reserved_local_field_options); |
| emboss_reserved_local_wrote_field = true; |
| if (emboss_reserved_local_field_options.multiline()) { |
| emboss_reserved_local_stream->Write("\n"); |
| } |
| } else if (emboss_reserved_local_field_options.allow_partial_output() && |
| emboss_reserved_local_field_options.comments() && |
| !a().IsAggregate() && !a().Ok()) { |
| if (emboss_reserved_local_field_options.multiline()) { |
| emboss_reserved_local_stream->Write( |
| emboss_reserved_local_field_options.current_indent()); |
| } |
| emboss_reserved_local_stream->Write("# a: UNREADABLE\n"); |
| } |
| } |
| |
| if (has_b().ValueOr(false)) { |
| if (!emboss_reserved_local_field_options.allow_partial_output() || |
| b().IsAggregate() || b().Ok()) { |
| if (emboss_reserved_local_field_options.multiline()) { |
| emboss_reserved_local_stream->Write( |
| emboss_reserved_local_field_options.current_indent()); |
| } else { |
| if (emboss_reserved_local_wrote_field) { |
| emboss_reserved_local_stream->Write(","); |
| } |
| emboss_reserved_local_stream->Write(" "); |
| } |
| emboss_reserved_local_stream->Write("b: "); |
| b().WriteToTextStream(emboss_reserved_local_stream, |
| emboss_reserved_local_field_options); |
| emboss_reserved_local_wrote_field = true; |
| if (emboss_reserved_local_field_options.multiline()) { |
| emboss_reserved_local_stream->Write("\n"); |
| } |
| } else if (emboss_reserved_local_field_options.allow_partial_output() && |
| emboss_reserved_local_field_options.comments() && |
| !b().IsAggregate() && !b().Ok()) { |
| if (emboss_reserved_local_field_options.multiline()) { |
| emboss_reserved_local_stream->Write( |
| emboss_reserved_local_field_options.current_indent()); |
| } |
| emboss_reserved_local_stream->Write("# b: UNREADABLE\n"); |
| } |
| } |
| |
| (void)emboss_reserved_local_wrote_field; |
| if (emboss_reserved_local_options.multiline()) { |
| emboss_reserved_local_stream->Write( |
| emboss_reserved_local_options.current_indent()); |
| emboss_reserved_local_stream->Write("}"); |
| } else { |
| emboss_reserved_local_stream->Write(" }"); |
| } |
| } |
| |
| |
| |
| static constexpr bool IsAggregate() { return true; } |
| |
| public: |
| typename ::emboss::prelude::UIntView< |
| /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, |
| typename ::emboss::support::BitBlock</**/::emboss::support::NullByteOrderer<typename Storage::template OffsetStorageType</**/0, 0>>, 8>> |
| |
| a() const; |
| ::emboss::support::Maybe<bool> has_a() const; |
| |
| public: |
| typename ::emboss::prelude::UIntView< |
| /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, |
| typename ::emboss::support::BitBlock</**/::emboss::support::NullByteOrderer<typename Storage::template OffsetStorageType</**/0, 1>>, 8>> |
| |
| b() const; |
| ::emboss::support::Maybe<bool> has_b() const; |
| |
| public: |
| class EmbossReservedDollarVirtualIntrinsicSizeInBytesView final { |
| public: |
| using ValueType = ::std::int32_t; |
| |
| constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView() {} |
| EmbossReservedDollarVirtualIntrinsicSizeInBytesView(const EmbossReservedDollarVirtualIntrinsicSizeInBytesView &) = default; |
| EmbossReservedDollarVirtualIntrinsicSizeInBytesView(EmbossReservedDollarVirtualIntrinsicSizeInBytesView &&) = default; |
| EmbossReservedDollarVirtualIntrinsicSizeInBytesView &operator=(const EmbossReservedDollarVirtualIntrinsicSizeInBytesView &) = |
| default; |
| EmbossReservedDollarVirtualIntrinsicSizeInBytesView &operator=(EmbossReservedDollarVirtualIntrinsicSizeInBytesView &&) = |
| default; |
| ~EmbossReservedDollarVirtualIntrinsicSizeInBytesView() = default; |
| |
| static constexpr ::std::int32_t Read(); |
| static constexpr ::std::int32_t UncheckedRead(); |
| static constexpr bool Ok() { return true; } |
| template <class Stream> |
| void WriteToTextStream(Stream *emboss_reserved_local_stream, |
| const ::emboss::TextOutputOptions |
| &emboss_reserved_local_options) const { |
| ::emboss::support::WriteIntegerViewToTextStream( |
| this, emboss_reserved_local_stream, emboss_reserved_local_options); |
| } |
| |
| static constexpr bool IsAggregate() { return false; } |
| }; |
| |
| static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { |
| return EmbossReservedDollarVirtualIntrinsicSizeInBytesView(); |
| } |
| static constexpr ::emboss::support::Maybe<bool> has_IntrinsicSizeInBytes() { |
| return ::emboss::support::Maybe<bool>(true); |
| } |
| |
| public: |
| class EmbossReservedDollarVirtualMaxSizeInBytesView final { |
| public: |
| using ValueType = ::std::int32_t; |
| |
| constexpr EmbossReservedDollarVirtualMaxSizeInBytesView() {} |
| EmbossReservedDollarVirtualMaxSizeInBytesView(const EmbossReservedDollarVirtualMaxSizeInBytesView &) = default; |
| EmbossReservedDollarVirtualMaxSizeInBytesView(EmbossReservedDollarVirtualMaxSizeInBytesView &&) = default; |
| EmbossReservedDollarVirtualMaxSizeInBytesView &operator=(const EmbossReservedDollarVirtualMaxSizeInBytesView &) = |
| default; |
| EmbossReservedDollarVirtualMaxSizeInBytesView &operator=(EmbossReservedDollarVirtualMaxSizeInBytesView &&) = |
| default; |
| ~EmbossReservedDollarVirtualMaxSizeInBytesView() = default; |
| |
| static constexpr ::std::int32_t Read(); |
| static constexpr ::std::int32_t UncheckedRead(); |
| static constexpr bool Ok() { return true; } |
| template <class Stream> |
| void WriteToTextStream(Stream *emboss_reserved_local_stream, |
| const ::emboss::TextOutputOptions |
| &emboss_reserved_local_options) const { |
| ::emboss::support::WriteIntegerViewToTextStream( |
| this, emboss_reserved_local_stream, emboss_reserved_local_options); |
| } |
| |
| static constexpr bool IsAggregate() { return false; } |
| }; |
| |
| static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { |
| return EmbossReservedDollarVirtualMaxSizeInBytesView(); |
| } |
| static constexpr ::emboss::support::Maybe<bool> has_MaxSizeInBytes() { |
| return ::emboss::support::Maybe<bool>(true); |
| } |
| |
| public: |
| class EmbossReservedDollarVirtualMinSizeInBytesView final { |
| public: |
| using ValueType = ::std::int32_t; |
| |
| constexpr EmbossReservedDollarVirtualMinSizeInBytesView() {} |
| EmbossReservedDollarVirtualMinSizeInBytesView(const EmbossReservedDollarVirtualMinSizeInBytesView &) = default; |
| EmbossReservedDollarVirtualMinSizeInBytesView(EmbossReservedDollarVirtualMinSizeInBytesView &&) = default; |
| EmbossReservedDollarVirtualMinSizeInBytesView &operator=(const EmbossReservedDollarVirtualMinSizeInBytesView &) = |
| default; |
| EmbossReservedDollarVirtualMinSizeInBytesView &operator=(EmbossReservedDollarVirtualMinSizeInBytesView &&) = |
| default; |
| ~EmbossReservedDollarVirtualMinSizeInBytesView() = default; |
| |
| static constexpr ::std::int32_t Read(); |
| static constexpr ::std::int32_t UncheckedRead(); |
| static constexpr bool Ok() { return true; } |
| template <class Stream> |
| void WriteToTextStream(Stream *emboss_reserved_local_stream, |
| const ::emboss::TextOutputOptions |
| &emboss_reserved_local_options) const { |
| ::emboss::support::WriteIntegerViewToTextStream( |
| this, emboss_reserved_local_stream, emboss_reserved_local_options); |
| } |
| |
| static constexpr bool IsAggregate() { return false; } |
| }; |
| |
| static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { |
| return EmbossReservedDollarVirtualMinSizeInBytesView(); |
| } |
| static constexpr ::emboss::support::Maybe<bool> has_MinSizeInBytes() { |
| return ::emboss::support::Maybe<bool>(true); |
| } |
| |
| |
| |
| private: |
| Storage backing_; |
| |
| |
| |
| template <class OtherStorage> |
| friend class GenericVanillaView; |
| }; |
| using VanillaView = |
| GenericVanillaView</**/ ::emboss::support::ReadOnlyContiguousBuffer>; |
| using VanillaWriter = |
| GenericVanillaView</**/ ::emboss::support::ReadWriteContiguousBuffer>; |
| |
| template <class View> |
| struct EmbossReservedInternalIsGenericVanillaView { |
| static constexpr const bool value = false; |
| }; |
| |
| template <class Storage> |
| struct EmbossReservedInternalIsGenericVanillaView< |
| GenericVanillaView<Storage>> { |
| static constexpr const bool value = true; |
| }; |
| |
| template <typename T> |
| inline GenericVanillaView< |
| /**/ ::emboss::support::ContiguousBuffer< |
| typename ::std::remove_reference< |
| decltype(*::std::declval<T>()->data())>::type, |
| 1, 0>> |
| MakeVanillaView( T &&emboss_reserved_local_arg) { |
| return GenericVanillaView< |
| /**/ ::emboss::support::ContiguousBuffer< |
| typename ::std::remove_reference<decltype( |
| *::std::declval<T>()->data())>::type, |
| 1, 0>>( |
| ::std::forward<T>(emboss_reserved_local_arg)); |
| } |
| |
| template <typename T> |
| inline GenericVanillaView</**/ ::emboss::support::ContiguousBuffer<T, 1, 0>> |
| MakeVanillaView( T *emboss_reserved_local_data, |
| ::std::size_t emboss_reserved_local_size) { |
| return GenericVanillaView</**/ ::emboss::support::ContiguousBuffer<T, 1, 0>>( |
| emboss_reserved_local_data, |
| emboss_reserved_local_size); |
| } |
| |
| template <typename T, ::std::size_t kAlignment> |
| inline GenericVanillaView< |
| /**/ ::emboss::support::ContiguousBuffer<T, kAlignment, 0>> |
| MakeAlignedVanillaView( |
| T *emboss_reserved_local_data, |
| ::std::size_t emboss_reserved_local_size) { |
| return GenericVanillaView< |
| /**/ ::emboss::support::ContiguousBuffer<T, kAlignment, 0>>( |
| emboss_reserved_local_data, |
| emboss_reserved_local_size); |
| } |
| |
| |
| |
| |
| |
| namespace StructWithSkippedFields { |
| |
| } // namespace StructWithSkippedFields |
| |
| |
| template <class View> |
| struct EmbossReservedInternalIsGenericStructWithSkippedFieldsView; |
| |
| template <class Storage> |
| class GenericStructWithSkippedFieldsView final { |
| public: |
| GenericStructWithSkippedFieldsView() : backing_() {} |
| explicit GenericStructWithSkippedFieldsView( |
| Storage emboss_reserved_local_bytes) |
| : backing_(emboss_reserved_local_bytes) |
| {} |
| |
| template <typename OtherStorage> |
| GenericStructWithSkippedFieldsView( |
| const GenericStructWithSkippedFieldsView<OtherStorage> &emboss_reserved_local_other) |
| : backing_{emboss_reserved_local_other.BackingStorage()} |
| {} |
| |
| template <typename Arg, |
| typename = typename ::std::enable_if< |
| !EmbossReservedInternalIsGenericStructWithSkippedFieldsView< |
| typename ::std::remove_cv<typename ::std::remove_reference< |
| Arg>::type>::type>::value>::type> |
| explicit GenericStructWithSkippedFieldsView( |
| Arg &&emboss_reserved_local_arg) |
| : backing_(::std::forward<Arg>( |
| emboss_reserved_local_arg)) |
| {} |
| template <typename Arg0, typename Arg1, typename... Args> |
| explicit GenericStructWithSkippedFieldsView( |
| Arg0 &&emboss_reserved_local_arg0, |
| Arg1 &&emboss_reserved_local_arg1, Args &&... emboss_reserved_local_args) |
| : backing_(::std::forward<Arg0>(emboss_reserved_local_arg0), |
| ::std::forward<Arg1>(emboss_reserved_local_arg1), |
| ::std::forward<Args>( |
| emboss_reserved_local_args)...) |
| {} |
| |
| template <typename OtherStorage> |
| GenericStructWithSkippedFieldsView<Storage> &operator=( |
| const GenericStructWithSkippedFieldsView<OtherStorage> &emboss_reserved_local_other) { |
| backing_ = emboss_reserved_local_other.BackingStorage(); |
| return *this; |
| } |
| |
| |
| |
| bool Ok() const { |
| if (!IsComplete()) return false; |
| |
| if (!has_a().Known()) return false; |
| if (has_a().ValueOrDefault() && !a().Ok()) return false; |
| |
| |
| if (!has_b().Known()) return false; |
| if (has_b().ValueOrDefault() && !b().Ok()) return false; |
| |
| |
| if (!has_c().Known()) return false; |
| if (has_c().ValueOrDefault() && !c().Ok()) return false; |
| |
| |
| if (!has_IntrinsicSizeInBytes().Known()) return false; |
| if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; |
| |
| |
| if (!has_MaxSizeInBytes().Known()) return false; |
| if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; |
| |
| |
| if (!has_MinSizeInBytes().Known()) return false; |
| if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().Ok()) return false; |
| |
| |
| |
| return true; |
| } |
| Storage BackingStorage() const { return backing_; } |
| bool IsComplete() const { |
| return backing_.Ok() && IntrinsicSizeInBytes().Ok() && |
| backing_.SizeInBytes() >= |
| static_cast</**/ ::std::size_t>( |
| IntrinsicSizeInBytes().UncheckedRead()); |
| } |
| static constexpr ::std::size_t SizeInBytes() { |
| return static_cast</**/ ::std::size_t>(IntrinsicSizeInBytes().Read()); |
| } |
| static constexpr bool SizeIsKnown() { |
| return IntrinsicSizeInBytes().Ok(); |
| } |
| |
| |
| template <typename OtherStorage> |
| bool Equals( |
| GenericStructWithSkippedFieldsView<OtherStorage> emboss_reserved_local_other) const { |
| |
| if (!has_a().Known()) return false; |
| if (!emboss_reserved_local_other.has_a().Known()) return false; |
| |
| if (emboss_reserved_local_other.has_a().ValueOrDefault() && |
| !has_a().ValueOrDefault()) |
| return false; |
| if (has_a().ValueOrDefault() && |
| !emboss_reserved_local_other.has_a().ValueOrDefault()) |
| return false; |
| |
| if (emboss_reserved_local_other.has_a().ValueOrDefault() && |
| has_a().ValueOrDefault() && |
| !a().Equals(emboss_reserved_local_other.a())) |
| return false; |
| |
| |
| |
| if (!has_b().Known()) return false; |
| if (!emboss_reserved_local_other.has_b().Known()) return false; |
| |
| if (emboss_reserved_local_other.has_b().ValueOrDefault() && |
| !has_b().ValueOrDefault()) |
| return false; |
| if (has_b().ValueOrDefault() && |
| !emboss_reserved_local_other.has_b().ValueOrDefault()) |
| return false; |
| |
| if (emboss_reserved_local_other.has_b().ValueOrDefault() && |
| has_b().ValueOrDefault() && |
| !b().Equals(emboss_reserved_local_other.b())) |
| return false; |
| |
| |
| |
| if (!has_c().Known()) return false; |
| if (!emboss_reserved_local_other.has_c().Known()) return false; |
| |
| if (emboss_reserved_local_other.has_c().ValueOrDefault() && |
| !has_c().ValueOrDefault()) |
| return false; |
| if (has_c().ValueOrDefault() && |
| !emboss_reserved_local_other.has_c().ValueOrDefault()) |
| return false; |
| |
| if (emboss_reserved_local_other.has_c().ValueOrDefault() && |
| has_c().ValueOrDefault() && |
| !c().Equals(emboss_reserved_local_other.c())) |
| return false; |
| |
| return true; |
| } |
| template <typename OtherStorage> |
| bool UncheckedEquals( |
| GenericStructWithSkippedFieldsView<OtherStorage> emboss_reserved_local_other) const { |
| |
| if (emboss_reserved_local_other.has_a().ValueOr(false) && |
| !has_a().ValueOr(false)) |
| return false; |
| if (has_a().ValueOr(false) && |
| !emboss_reserved_local_other.has_a().ValueOr(false)) |
| return false; |
| |
| if (emboss_reserved_local_other.has_a().ValueOr(false) && |
| has_a().ValueOr(false) && |
| !a().UncheckedEquals(emboss_reserved_local_other.a())) |
| return false; |
| |
| |
| |
| if (emboss_reserved_local_other.has_b().ValueOr(false) && |
| !has_b().ValueOr(false)) |
| return false; |
| if (has_b().ValueOr(false) && |
| !emboss_reserved_local_other.has_b().ValueOr(false)) |
| return false; |
| |
| if (emboss_reserved_local_other.has_b().ValueOr(false) && |
| has_b().ValueOr(false) && |
| !b().UncheckedEquals(emboss_reserved_local_other.b())) |
| return false; |
| |
| |
| |
| if (emboss_reserved_local_other.has_c().ValueOr(false) && |
| !has_c().ValueOr(false)) |
| return false; |
| if (has_c().ValueOr(false) && |
| !emboss_reserved_local_other.has_c().ValueOr(false)) |
| return false; |
| |
| if (emboss_reserved_local_other.has_c().ValueOr(false) && |
| has_c().ValueOr(false) && |
| !c().UncheckedEquals(emboss_reserved_local_other.c())) |
| return false; |
| |
| return true; |
| } |
| template <typename OtherStorage> |
| void UncheckedCopyFrom( |
| GenericStructWithSkippedFieldsView<OtherStorage> emboss_reserved_local_other) const { |
| backing_.UncheckedCopyFrom( |
| emboss_reserved_local_other.BackingStorage(), |
| emboss_reserved_local_other.IntrinsicSizeInBytes().UncheckedRead()); |
| } |
| |
| template <typename OtherStorage> |
| void CopyFrom( |
| GenericStructWithSkippedFieldsView<OtherStorage> emboss_reserved_local_other) const { |
| backing_.CopyFrom( |
| emboss_reserved_local_other.BackingStorage(), |
| emboss_reserved_local_other.IntrinsicSizeInBytes().Read()); |
| } |
| template <typename OtherStorage> |
| bool TryToCopyFrom( |
| GenericStructWithSkippedFieldsView<OtherStorage> emboss_reserved_local_other) const { |
| return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( |
| emboss_reserved_local_other.BackingStorage(), |
| emboss_reserved_local_other.IntrinsicSizeInBytes().Read()); |
| } |
| |
| template <class Stream> |
| bool UpdateFromTextStream(Stream *emboss_reserved_local_stream) const { |
| ::std::string emboss_reserved_local_brace; |
| if (!::emboss::support::ReadToken(emboss_reserved_local_stream, |
| &emboss_reserved_local_brace)) |
| return false; |
| if (emboss_reserved_local_brace != "{") return false; |
| for (;;) { |
| ::std::string emboss_reserved_local_name; |
| if (!::emboss::support::ReadToken(emboss_reserved_local_stream, |
| &emboss_reserved_local_name)) |
| return false; |
| if (emboss_reserved_local_name == ",") |
| if (!::emboss::support::ReadToken(emboss_reserved_local_stream, |
| &emboss_reserved_local_name)) |
| return false; |
| if (emboss_reserved_local_name == "}") return true; |
| ::std::string emboss_reserved_local_colon; |
| if (!::emboss::support::ReadToken(emboss_reserved_local_stream, |
| &emboss_reserved_local_colon)) |
| return false; |
| if (emboss_reserved_local_colon != ":") return false; |
| if (emboss_reserved_local_name == "a") { |
| if (!a().UpdateFromTextStream( |
| emboss_reserved_local_stream)) { |
| return false; |
| } |
| continue; |
| } |
| |
| if (emboss_reserved_local_name == "b") { |
| if (!b().UpdateFromTextStream( |
| emboss_reserved_local_stream)) { |
| return false; |
| } |
| continue; |
| } |
| |
| if (emboss_reserved_local_name == "c") { |
| if (!c().UpdateFromTextStream( |
| emboss_reserved_local_stream)) { |
| return false; |
| } |
| continue; |
| } |
| |
| return false; |
| } |
| } |
| |
| template <class Stream> |
| void WriteToTextStream( |
| Stream *emboss_reserved_local_stream, |
| ::emboss::TextOutputOptions emboss_reserved_local_options) const { |
| ::emboss::TextOutputOptions emboss_reserved_local_field_options = |
| emboss_reserved_local_options.PlusOneIndent(); |
| if (emboss_reserved_local_options.multiline()) { |
| emboss_reserved_local_stream->Write("{\n"); |
| } else { |
| emboss_reserved_local_stream->Write("{"); |
| } |
| bool emboss_reserved_local_wrote_field = false; |
| if (has_a().ValueOr(false)) { |
| if (!emboss_reserved_local_field_options.allow_partial_output() || |
| a().IsAggregate() || a().Ok()) { |
| if (emboss_reserved_local_field_options.multiline()) { |
| emboss_reserved_local_stream->Write( |
| emboss_reserved_local_field_options.current_indent()); |
| } else { |
| if (emboss_reserved_local_wrote_field) { |
| emboss_reserved_local_stream->Write(","); |
| } |
| emboss_reserved_local_stream->Write(" "); |
| } |
| emboss_reserved_local_stream->Write("a: "); |
| a().WriteToTextStream(emboss_reserved_local_stream, |
| emboss_reserved_local_field_options); |
| emboss_reserved_local_wrote_field = true; |
| if (emboss_reserved_local_field_options.multiline()) { |
| emboss_reserved_local_stream->Write("\n"); |
| } |
| } else if (emboss_reserved_local_field_options.allow_partial_output() && |
| emboss_reserved_local_field_options.comments() && |
| !a().IsAggregate() && !a().Ok()) { |
| if (emboss_reserved_local_field_options.multiline()) { |
| emboss_reserved_local_stream->Write( |
| emboss_reserved_local_field_options.current_indent()); |
| } |
| emboss_reserved_local_stream->Write("# a: UNREADABLE\n"); |
| } |
| } |
| |
| if (has_c().ValueOr(false)) { |
| if (!emboss_reserved_local_field_options.allow_partial_output() || |
| c().IsAggregate() || c().Ok()) { |
| if (emboss_reserved_local_field_options.multiline()) { |
| emboss_reserved_local_stream->Write( |
| emboss_reserved_local_field_options.current_indent()); |
| } else { |
| if (emboss_reserved_local_wrote_field) { |
| emboss_reserved_local_stream->Write(","); |
| } |
| emboss_reserved_local_stream->Write(" "); |
| } |
| emboss_reserved_local_stream->Write("c: "); |
| c().WriteToTextStream(emboss_reserved_local_stream, |
| emboss_reserved_local_field_options); |
| emboss_reserved_local_wrote_field = true; |
| if (emboss_reserved_local_field_options.multiline()) { |
| emboss_reserved_local_stream->Write("\n"); |
| } |
| } else if (emboss_reserved_local_field_options.allow_partial_output() && |
| emboss_reserved_local_field_options.comments() && |
| !c().IsAggregate() && !c().Ok()) { |
| if (emboss_reserved_local_field_options.multiline()) { |
| emboss_reserved_local_stream->Write( |
| emboss_reserved_local_field_options.current_indent()); |
| } |
| emboss_reserved_local_stream->Write("# c: UNREADABLE\n"); |
| } |
| } |
| |
| (void)emboss_reserved_local_wrote_field; |
| if (emboss_reserved_local_options.multiline()) { |
| emboss_reserved_local_stream->Write( |
| emboss_reserved_local_options.current_indent()); |
| emboss_reserved_local_stream->Write("}"); |
| } else { |
| emboss_reserved_local_stream->Write(" }"); |
| } |
| } |
| |
| |
| |
| static constexpr bool IsAggregate() { return true; } |
| |
| public: |
| typename ::emboss::prelude::UIntView< |
| /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, |
| typename ::emboss::support::BitBlock</**/::emboss::support::NullByteOrderer<typename Storage::template OffsetStorageType</**/0, 0>>, 8>> |
| |
| a() const; |
| ::emboss::support::Maybe<bool> has_a() const; |
| |
| public: |
| typename ::emboss::prelude::UIntView< |
| /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, |
| typename ::emboss::support::BitBlock</**/::emboss::support::NullByteOrderer<typename Storage::template OffsetStorageType</**/0, 1>>, 8>> |
| |
| b() const; |
| ::emboss::support::Maybe<bool> has_b() const; |
| |
| public: |
| typename ::emboss::prelude::UIntView< |
| /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, |
| typename ::emboss::support::BitBlock</**/::emboss::support::NullByteOrderer<typename Storage::template OffsetStorageType</**/0, 2>>, 8>> |
| |
| c() const; |
| ::emboss::support::Maybe<bool> has_c() const; |
| |
| public: |
| class EmbossReservedDollarVirtualIntrinsicSizeInBytesView final { |
| public: |
| using ValueType = ::std::int32_t; |
| |
| constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView() {} |
| EmbossReservedDollarVirtualIntrinsicSizeInBytesView(const EmbossReservedDollarVirtualIntrinsicSizeInBytesView &) = default; |
| EmbossReservedDollarVirtualIntrinsicSizeInBytesView(EmbossReservedDollarVirtualIntrinsicSizeInBytesView &&) = default; |
| EmbossReservedDollarVirtualIntrinsicSizeInBytesView &operator=(const EmbossReservedDollarVirtualIntrinsicSizeInBytesView &) = |
| default; |
| EmbossReservedDollarVirtualIntrinsicSizeInBytesView &operator=(EmbossReservedDollarVirtualIntrinsicSizeInBytesView &&) = |
| default; |
| ~EmbossReservedDollarVirtualIntrinsicSizeInBytesView() = default; |
| |
| static constexpr ::std::int32_t Read(); |
| static constexpr ::std::int32_t UncheckedRead(); |
| static constexpr bool Ok() { return true; } |
| template <class Stream> |
| void WriteToTextStream(Stream *emboss_reserved_local_stream, |
| const ::emboss::TextOutputOptions |
| &emboss_reserved_local_options) const { |
| ::emboss::support::WriteIntegerViewToTextStream( |
| this, emboss_reserved_local_stream, emboss_reserved_local_options); |
| } |
| |
| static constexpr bool IsAggregate() { return false; } |
| }; |
| |
| static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { |
| return EmbossReservedDollarVirtualIntrinsicSizeInBytesView(); |
| } |
| static constexpr ::emboss::support::Maybe<bool> has_IntrinsicSizeInBytes() { |
| return ::emboss::support::Maybe<bool>(true); |
| } |
| |
| public: |
| class EmbossReservedDollarVirtualMaxSizeInBytesView final { |
| public: |
| using ValueType = ::std::int32_t; |
| |
| constexpr EmbossReservedDollarVirtualMaxSizeInBytesView() {} |
| EmbossReservedDollarVirtualMaxSizeInBytesView(const EmbossReservedDollarVirtualMaxSizeInBytesView &) = default; |
| EmbossReservedDollarVirtualMaxSizeInBytesView(EmbossReservedDollarVirtualMaxSizeInBytesView &&) = default; |
| EmbossReservedDollarVirtualMaxSizeInBytesView &operator=(const EmbossReservedDollarVirtualMaxSizeInBytesView &) = |
| default; |
| EmbossReservedDollarVirtualMaxSizeInBytesView &operator=(EmbossReservedDollarVirtualMaxSizeInBytesView &&) = |
| default; |
| ~EmbossReservedDollarVirtualMaxSizeInBytesView() = default; |
| |
| static constexpr ::std::int32_t Read(); |
| static constexpr ::std::int32_t UncheckedRead(); |
| static constexpr bool Ok() { return true; } |
| template <class Stream> |
| void WriteToTextStream(Stream *emboss_reserved_local_stream, |
| const ::emboss::TextOutputOptions |
| &emboss_reserved_local_options) const { |
| ::emboss::support::WriteIntegerViewToTextStream( |
| this, emboss_reserved_local_stream, emboss_reserved_local_options); |
| } |
| |
| static constexpr bool IsAggregate() { return false; } |
| }; |
| |
| static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { |
| return EmbossReservedDollarVirtualMaxSizeInBytesView(); |
| } |
| static constexpr ::emboss::support::Maybe<bool> has_MaxSizeInBytes() { |
| return ::emboss::support::Maybe<bool>(true); |
| } |
| |
| public: |
| class EmbossReservedDollarVirtualMinSizeInBytesView final { |
| public: |
| using ValueType = ::std::int32_t; |
| |
| constexpr EmbossReservedDollarVirtualMinSizeInBytesView() {} |
| EmbossReservedDollarVirtualMinSizeInBytesView(const EmbossReservedDollarVirtualMinSizeInBytesView &) = default; |
| EmbossReservedDollarVirtualMinSizeInBytesView(EmbossReservedDollarVirtualMinSizeInBytesView &&) = default; |
| EmbossReservedDollarVirtualMinSizeInBytesView &operator=(const EmbossReservedDollarVirtualMinSizeInBytesView &) = |
| default; |
| EmbossReservedDollarVirtualMinSizeInBytesView &operator=(EmbossReservedDollarVirtualMinSizeInBytesView &&) = |
| default; |
| ~EmbossReservedDollarVirtualMinSizeInBytesView() = default; |
| |
| static constexpr ::std::int32_t Read(); |
| static constexpr ::std::int32_t UncheckedRead(); |
| static constexpr bool Ok() { return true; } |
| template <class Stream> |
| void WriteToTextStream(Stream *emboss_reserved_local_stream, |
| const ::emboss::TextOutputOptions |
| &emboss_reserved_local_options) const { |
| ::emboss::support::WriteIntegerViewToTextStream( |
| this, emboss_reserved_local_stream, emboss_reserved_local_options); |
| } |
| |
| static constexpr bool IsAggregate() { return false; } |
| }; |
| |
| static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { |
| return EmbossReservedDollarVirtualMinSizeInBytesView(); |
| } |
| static constexpr ::emboss::support::Maybe<bool> has_MinSizeInBytes() { |
| return ::emboss::support::Maybe<bool>(true); |
| } |
| |
| |
| |
| private: |
| Storage backing_; |
| |
| |
| |
| template <class OtherStorage> |
| friend class GenericStructWithSkippedFieldsView; |
| }; |
| using StructWithSkippedFieldsView = |
| GenericStructWithSkippedFieldsView</**/ ::emboss::support::ReadOnlyContiguousBuffer>; |
| using StructWithSkippedFieldsWriter = |
| GenericStructWithSkippedFieldsView</**/ ::emboss::support::ReadWriteContiguousBuffer>; |
| |
| template <class View> |
| struct EmbossReservedInternalIsGenericStructWithSkippedFieldsView { |
| static constexpr const bool value = false; |
| }; |
| |
| template <class Storage> |
| struct EmbossReservedInternalIsGenericStructWithSkippedFieldsView< |
| GenericStructWithSkippedFieldsView<Storage>> { |
| static constexpr const bool value = true; |
| }; |
| |
| template <typename T> |
| inline GenericStructWithSkippedFieldsView< |
| /**/ ::emboss::support::ContiguousBuffer< |
| typename ::std::remove_reference< |
| decltype(*::std::declval<T>()->data())>::type, |
| 1, 0>> |
| MakeStructWithSkippedFieldsView( T &&emboss_reserved_local_arg) { |
| return GenericStructWithSkippedFieldsView< |
| /**/ ::emboss::support::ContiguousBuffer< |
| typename ::std::remove_reference<decltype( |
| *::std::declval<T>()->data())>::type, |
| 1, 0>>( |
| ::std::forward<T>(emboss_reserved_local_arg)); |
| } |
| |
| template <typename T> |
| inline GenericStructWithSkippedFieldsView</**/ ::emboss::support::ContiguousBuffer<T, 1, 0>> |
| MakeStructWithSkippedFieldsView( T *emboss_reserved_local_data, |
| ::std::size_t emboss_reserved_local_size) { |
| return GenericStructWithSkippedFieldsView</**/ ::emboss::support::ContiguousBuffer<T, 1, 0>>( |
| emboss_reserved_local_data, |
| emboss_reserved_local_size); |
| } |
| |
| template <typename T, ::std::size_t kAlignment> |
| inline GenericStructWithSkippedFieldsView< |
| /**/ ::emboss::support::ContiguousBuffer<T, kAlignment, 0>> |
| MakeAlignedStructWithSkippedFieldsView( |
| T *emboss_reserved_local_data, |
| ::std::size_t emboss_reserved_local_size) { |
| return GenericStructWithSkippedFieldsView< |
| /**/ ::emboss::support::ContiguousBuffer<T, kAlignment, 0>>( |
| emboss_reserved_local_data, |
| emboss_reserved_local_size); |
| } |
| |
| |
| |
| |
| |
| namespace StructWithSkippedStructureFields { |
| |
| } // namespace StructWithSkippedStructureFields |
| |
| |
| template <class View> |
| struct EmbossReservedInternalIsGenericStructWithSkippedStructureFieldsView; |
| |
| template <class Storage> |
| class GenericStructWithSkippedStructureFieldsView final { |
| public: |
| GenericStructWithSkippedStructureFieldsView() : backing_() {} |
| explicit GenericStructWithSkippedStructureFieldsView( |
| Storage emboss_reserved_local_bytes) |
| : backing_(emboss_reserved_local_bytes) |
| {} |
| |
| template <typename OtherStorage> |
| GenericStructWithSkippedStructureFieldsView( |
| const GenericStructWithSkippedStructureFieldsView<OtherStorage> &emboss_reserved_local_other) |
| : backing_{emboss_reserved_local_other.BackingStorage()} |
| {} |
| |
| template <typename Arg, |
| typename = typename ::std::enable_if< |
| !EmbossReservedInternalIsGenericStructWithSkippedStructureFieldsView< |
| typename ::std::remove_cv<typename ::std::remove_reference< |
| Arg>::type>::type>::value>::type> |
| explicit GenericStructWithSkippedStructureFieldsView( |
| Arg &&emboss_reserved_local_arg) |
| : backing_(::std::forward<Arg>( |
| emboss_reserved_local_arg)) |
| {} |
| template <typename Arg0, typename Arg1, typename... Args> |
| explicit GenericStructWithSkippedStructureFieldsView( |
| Arg0 &&emboss_reserved_local_arg0, |
| Arg1 &&emboss_reserved_local_arg1, Args &&... emboss_reserved_local_args) |
| : backing_(::std::forward<Arg0>(emboss_reserved_local_arg0), |
| ::std::forward<Arg1>(emboss_reserved_local_arg1), |
| ::std::forward<Args>( |
| emboss_reserved_local_args)...) |
| {} |
| |
| template <typename OtherStorage> |
| GenericStructWithSkippedStructureFieldsView<Storage> &operator=( |
| const GenericStructWithSkippedStructureFieldsView<OtherStorage> &emboss_reserved_local_other) { |
| backing_ = emboss_reserved_local_other.BackingStorage(); |
| return *this; |
| } |
| |
| |
| |
| bool Ok() const { |
| if (!IsComplete()) return false; |
| |
| if (!has_a().Known()) return false; |
| if (has_a().ValueOrDefault() && !a().Ok()) return false; |
| |
| |
| if (!has_b().Known()) return false; |
| if (has_b().ValueOrDefault() && !b().Ok()) return false; |
| |
| |
| if (!has_c().Known()) return false; |
| if (has_c().ValueOrDefault() && !c().Ok()) return false; |
| |
| |
| if (!has_IntrinsicSizeInBytes().Known()) return false; |
| if (has_IntrinsicSizeInBytes().ValueOrDefault() && !IntrinsicSizeInBytes().Ok()) return false; |
| |
| |
| if (!has_MaxSizeInBytes().Known()) return false; |
| if (has_MaxSizeInBytes().ValueOrDefault() && !MaxSizeInBytes().Ok()) return false; |
| |
| |
| if (!has_MinSizeInBytes().Known()) return false; |
| if (has_MinSizeInBytes().ValueOrDefault() && !MinSizeInBytes().Ok()) return false; |
| |
| |
| |
| return true; |
| } |
| Storage BackingStorage() const { return backing_; } |
| bool IsComplete() const { |
| return backing_.Ok() && IntrinsicSizeInBytes().Ok() && |
| backing_.SizeInBytes() >= |
| static_cast</**/ ::std::size_t>( |
| IntrinsicSizeInBytes().UncheckedRead()); |
| } |
| static constexpr ::std::size_t SizeInBytes() { |
| return static_cast</**/ ::std::size_t>(IntrinsicSizeInBytes().Read()); |
| } |
| static constexpr bool SizeIsKnown() { |
| return IntrinsicSizeInBytes().Ok(); |
| } |
| |
| |
| template <typename OtherStorage> |
| bool Equals( |
| GenericStructWithSkippedStructureFieldsView<OtherStorage> emboss_reserved_local_other) const { |
| |
| if (!has_a().Known()) return false; |
| if (!emboss_reserved_local_other.has_a().Known()) return false; |
| |
| if (emboss_reserved_local_other.has_a().ValueOrDefault() && |
| !has_a().ValueOrDefault()) |
| return false; |
| if (has_a().ValueOrDefault() && |
| !emboss_reserved_local_other.has_a().ValueOrDefault()) |
| return false; |
| |
| if (emboss_reserved_local_other.has_a().ValueOrDefault() && |
| has_a().ValueOrDefault() && |
| !a().Equals(emboss_reserved_local_other.a())) |
| return false; |
| |
| |
| |
| if (!has_b().Known()) return false; |
| if (!emboss_reserved_local_other.has_b().Known()) return false; |
| |
| if (emboss_reserved_local_other.has_b().ValueOrDefault() && |
| !has_b().ValueOrDefault()) |
| return false; |
| if (has_b().ValueOrDefault() && |
| !emboss_reserved_local_other.has_b().ValueOrDefault()) |
| return false; |
| |
| if (emboss_reserved_local_other.has_b().ValueOrDefault() && |
| has_b().ValueOrDefault() && |
| !b().Equals(emboss_reserved_local_other.b())) |
| return false; |
| |
| |
| |
| if (!has_c().Known()) return false; |
| if (!emboss_reserved_local_other.has_c().Known()) return false; |
| |
| if (emboss_reserved_local_other.has_c().ValueOrDefault() && |
| !has_c().ValueOrDefault()) |
| return false; |
| if (has_c().ValueOrDefault() && |
| !emboss_reserved_local_other.has_c().ValueOrDefault()) |
| return false; |
| |
| if (emboss_reserved_local_other.has_c().ValueOrDefault() && |
| has_c().ValueOrDefault() && |
| !c().Equals(emboss_reserved_local_other.c())) |
| return false; |
| |
| return true; |
| } |
| template <typename OtherStorage> |
| bool UncheckedEquals( |
| GenericStructWithSkippedStructureFieldsView<OtherStorage> emboss_reserved_local_other) const { |
| |
| if (emboss_reserved_local_other.has_a().ValueOr(false) && |
| !has_a().ValueOr(false)) |
| return false; |
| if (has_a().ValueOr(false) && |
| !emboss_reserved_local_other.has_a().ValueOr(false)) |
| return false; |
| |
| if (emboss_reserved_local_other.has_a().ValueOr(false) && |
| has_a().ValueOr(false) && |
| !a().UncheckedEquals(emboss_reserved_local_other.a())) |
| return false; |
| |
| |
| |
| if (emboss_reserved_local_other.has_b().ValueOr(false) && |
| !has_b().ValueOr(false)) |
| return false; |
| if (has_b().ValueOr(false) && |
| !emboss_reserved_local_other.has_b().ValueOr(false)) |
| return false; |
| |
| if (emboss_reserved_local_other.has_b().ValueOr(false) && |
| has_b().ValueOr(false) && |
| !b().UncheckedEquals(emboss_reserved_local_other.b())) |
| return false; |
| |
| |
| |
| if (emboss_reserved_local_other.has_c().ValueOr(false) && |
| !has_c().ValueOr(false)) |
| return false; |
| if (has_c().ValueOr(false) && |
| !emboss_reserved_local_other.has_c().ValueOr(false)) |
| return false; |
| |
| if (emboss_reserved_local_other.has_c().ValueOr(false) && |
| has_c().ValueOr(false) && |
| !c().UncheckedEquals(emboss_reserved_local_other.c())) |
| return false; |
| |
| return true; |
| } |
| template <typename OtherStorage> |
| void UncheckedCopyFrom( |
| GenericStructWithSkippedStructureFieldsView<OtherStorage> emboss_reserved_local_other) const { |
| backing_.UncheckedCopyFrom( |
| emboss_reserved_local_other.BackingStorage(), |
| emboss_reserved_local_other.IntrinsicSizeInBytes().UncheckedRead()); |
| } |
| |
| template <typename OtherStorage> |
| void CopyFrom( |
| GenericStructWithSkippedStructureFieldsView<OtherStorage> emboss_reserved_local_other) const { |
| backing_.CopyFrom( |
| emboss_reserved_local_other.BackingStorage(), |
| emboss_reserved_local_other.IntrinsicSizeInBytes().Read()); |
| } |
| template <typename OtherStorage> |
| bool TryToCopyFrom( |
| GenericStructWithSkippedStructureFieldsView<OtherStorage> emboss_reserved_local_other) const { |
| return emboss_reserved_local_other.Ok() && backing_.TryToCopyFrom( |
| emboss_reserved_local_other.BackingStorage(), |
| emboss_reserved_local_other.IntrinsicSizeInBytes().Read()); |
| } |
| |
| template <class Stream> |
| bool UpdateFromTextStream(Stream *emboss_reserved_local_stream) const { |
| ::std::string emboss_reserved_local_brace; |
| if (!::emboss::support::ReadToken(emboss_reserved_local_stream, |
| &emboss_reserved_local_brace)) |
| return false; |
| if (emboss_reserved_local_brace != "{") return false; |
| for (;;) { |
| ::std::string emboss_reserved_local_name; |
| if (!::emboss::support::ReadToken(emboss_reserved_local_stream, |
| &emboss_reserved_local_name)) |
| return false; |
| if (emboss_reserved_local_name == ",") |
| if (!::emboss::support::ReadToken(emboss_reserved_local_stream, |
| &emboss_reserved_local_name)) |
| return false; |
| if (emboss_reserved_local_name == "}") return true; |
| ::std::string emboss_reserved_local_colon; |
| if (!::emboss::support::ReadToken(emboss_reserved_local_stream, |
| &emboss_reserved_local_colon)) |
| return false; |
| if (emboss_reserved_local_colon != ":") return false; |
| if (emboss_reserved_local_name == "a") { |
| if (!a().UpdateFromTextStream( |
| emboss_reserved_local_stream)) { |
| return false; |
| } |
| continue; |
| } |
| |
| if (emboss_reserved_local_name == "b") { |
| if (!b().UpdateFromTextStream( |
| emboss_reserved_local_stream)) { |
| return false; |
| } |
| continue; |
| } |
| |
| if (emboss_reserved_local_name == "c") { |
| if (!c().UpdateFromTextStream( |
| emboss_reserved_local_stream)) { |
| return false; |
| } |
| continue; |
| } |
| |
| return false; |
| } |
| } |
| |
| template <class Stream> |
| void WriteToTextStream( |
| Stream *emboss_reserved_local_stream, |
| ::emboss::TextOutputOptions emboss_reserved_local_options) const { |
| ::emboss::TextOutputOptions emboss_reserved_local_field_options = |
| emboss_reserved_local_options.PlusOneIndent(); |
| if (emboss_reserved_local_options.multiline()) { |
| emboss_reserved_local_stream->Write("{\n"); |
| } else { |
| emboss_reserved_local_stream->Write("{"); |
| } |
| bool emboss_reserved_local_wrote_field = false; |
| if (has_a().ValueOr(false)) { |
| if (!emboss_reserved_local_field_options.allow_partial_output() || |
| a().IsAggregate() || a().Ok()) { |
| if (emboss_reserved_local_field_options.multiline()) { |
| emboss_reserved_local_stream->Write( |
| emboss_reserved_local_field_options.current_indent()); |
| } else { |
| if (emboss_reserved_local_wrote_field) { |
| emboss_reserved_local_stream->Write(","); |
| } |
| emboss_reserved_local_stream->Write(" "); |
| } |
| emboss_reserved_local_stream->Write("a: "); |
| a().WriteToTextStream(emboss_reserved_local_stream, |
| emboss_reserved_local_field_options); |
| emboss_reserved_local_wrote_field = true; |
| if (emboss_reserved_local_field_options.multiline()) { |
| emboss_reserved_local_stream->Write("\n"); |
| } |
| } else if (emboss_reserved_local_field_options.allow_partial_output() && |
| emboss_reserved_local_field_options.comments() && |
| !a().IsAggregate() && !a().Ok()) { |
| if (emboss_reserved_local_field_options.multiline()) { |
| emboss_reserved_local_stream->Write( |
| emboss_reserved_local_field_options.current_indent()); |
| } |
| emboss_reserved_local_stream->Write("# a: UNREADABLE\n"); |
| } |
| } |
| |
| if (has_c().ValueOr(false)) { |
| if (!emboss_reserved_local_field_options.allow_partial_output() || |
| c().IsAggregate() || c().Ok()) { |
| if (emboss_reserved_local_field_options.multiline()) { |
| emboss_reserved_local_stream->Write( |
| emboss_reserved_local_field_options.current_indent()); |
| } else { |
| if (emboss_reserved_local_wrote_field) { |
| emboss_reserved_local_stream->Write(","); |
| } |
| emboss_reserved_local_stream->Write(" "); |
| } |
| emboss_reserved_local_stream->Write("c: "); |
| c().WriteToTextStream(emboss_reserved_local_stream, |
| emboss_reserved_local_field_options); |
| emboss_reserved_local_wrote_field = true; |
| if (emboss_reserved_local_field_options.multiline()) { |
| emboss_reserved_local_stream->Write("\n"); |
| } |
| } else if (emboss_reserved_local_field_options.allow_partial_output() && |
| emboss_reserved_local_field_options.comments() && |
| !c().IsAggregate() && !c().Ok()) { |
| if (emboss_reserved_local_field_options.multiline()) { |
| emboss_reserved_local_stream->Write( |
| emboss_reserved_local_field_options.current_indent()); |
| } |
| emboss_reserved_local_stream->Write("# c: UNREADABLE\n"); |
| } |
| } |
| |
| (void)emboss_reserved_local_wrote_field; |
| if (emboss_reserved_local_options.multiline()) { |
| emboss_reserved_local_stream->Write( |
| emboss_reserved_local_options.current_indent()); |
| emboss_reserved_local_stream->Write("}"); |
| } else { |
| emboss_reserved_local_stream->Write(" }"); |
| } |
| } |
| |
| |
| |
| static constexpr bool IsAggregate() { return true; } |
| |
| public: |
| typename ::emboss::test::GenericVanillaView<typename Storage::template OffsetStorageType</**/0, 0>> |
| |
| a() const; |
| ::emboss::support::Maybe<bool> has_a() const; |
| |
| public: |
| typename ::emboss::test::GenericVanillaView<typename Storage::template OffsetStorageType</**/0, 2>> |
| |
| b() const; |
| ::emboss::support::Maybe<bool> has_b() const; |
| |
| public: |
| typename ::emboss::test::GenericVanillaView<typename Storage::template OffsetStorageType</**/0, 4>> |
| |
| c() const; |
| ::emboss::support::Maybe<bool> has_c() const; |
| |
| public: |
| class EmbossReservedDollarVirtualIntrinsicSizeInBytesView final { |
| public: |
| using ValueType = ::std::int32_t; |
| |
| constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView() {} |
| EmbossReservedDollarVirtualIntrinsicSizeInBytesView(const EmbossReservedDollarVirtualIntrinsicSizeInBytesView &) = default; |
| EmbossReservedDollarVirtualIntrinsicSizeInBytesView(EmbossReservedDollarVirtualIntrinsicSizeInBytesView &&) = default; |
| EmbossReservedDollarVirtualIntrinsicSizeInBytesView &operator=(const EmbossReservedDollarVirtualIntrinsicSizeInBytesView &) = |
| default; |
| EmbossReservedDollarVirtualIntrinsicSizeInBytesView &operator=(EmbossReservedDollarVirtualIntrinsicSizeInBytesView &&) = |
| default; |
| ~EmbossReservedDollarVirtualIntrinsicSizeInBytesView() = default; |
| |
| static constexpr ::std::int32_t Read(); |
| static constexpr ::std::int32_t UncheckedRead(); |
| static constexpr bool Ok() { return true; } |
| template <class Stream> |
| void WriteToTextStream(Stream *emboss_reserved_local_stream, |
| const ::emboss::TextOutputOptions |
| &emboss_reserved_local_options) const { |
| ::emboss::support::WriteIntegerViewToTextStream( |
| this, emboss_reserved_local_stream, emboss_reserved_local_options); |
| } |
| |
| static constexpr bool IsAggregate() { return false; } |
| }; |
| |
| static constexpr EmbossReservedDollarVirtualIntrinsicSizeInBytesView IntrinsicSizeInBytes() { |
| return EmbossReservedDollarVirtualIntrinsicSizeInBytesView(); |
| } |
| static constexpr ::emboss::support::Maybe<bool> has_IntrinsicSizeInBytes() { |
| return ::emboss::support::Maybe<bool>(true); |
| } |
| |
| public: |
| class EmbossReservedDollarVirtualMaxSizeInBytesView final { |
| public: |
| using ValueType = ::std::int32_t; |
| |
| constexpr EmbossReservedDollarVirtualMaxSizeInBytesView() {} |
| EmbossReservedDollarVirtualMaxSizeInBytesView(const EmbossReservedDollarVirtualMaxSizeInBytesView &) = default; |
| EmbossReservedDollarVirtualMaxSizeInBytesView(EmbossReservedDollarVirtualMaxSizeInBytesView &&) = default; |
| EmbossReservedDollarVirtualMaxSizeInBytesView &operator=(const EmbossReservedDollarVirtualMaxSizeInBytesView &) = |
| default; |
| EmbossReservedDollarVirtualMaxSizeInBytesView &operator=(EmbossReservedDollarVirtualMaxSizeInBytesView &&) = |
| default; |
| ~EmbossReservedDollarVirtualMaxSizeInBytesView() = default; |
| |
| static constexpr ::std::int32_t Read(); |
| static constexpr ::std::int32_t UncheckedRead(); |
| static constexpr bool Ok() { return true; } |
| template <class Stream> |
| void WriteToTextStream(Stream *emboss_reserved_local_stream, |
| const ::emboss::TextOutputOptions |
| &emboss_reserved_local_options) const { |
| ::emboss::support::WriteIntegerViewToTextStream( |
| this, emboss_reserved_local_stream, emboss_reserved_local_options); |
| } |
| |
| static constexpr bool IsAggregate() { return false; } |
| }; |
| |
| static constexpr EmbossReservedDollarVirtualMaxSizeInBytesView MaxSizeInBytes() { |
| return EmbossReservedDollarVirtualMaxSizeInBytesView(); |
| } |
| static constexpr ::emboss::support::Maybe<bool> has_MaxSizeInBytes() { |
| return ::emboss::support::Maybe<bool>(true); |
| } |
| |
| public: |
| class EmbossReservedDollarVirtualMinSizeInBytesView final { |
| public: |
| using ValueType = ::std::int32_t; |
| |
| constexpr EmbossReservedDollarVirtualMinSizeInBytesView() {} |
| EmbossReservedDollarVirtualMinSizeInBytesView(const EmbossReservedDollarVirtualMinSizeInBytesView &) = default; |
| EmbossReservedDollarVirtualMinSizeInBytesView(EmbossReservedDollarVirtualMinSizeInBytesView &&) = default; |
| EmbossReservedDollarVirtualMinSizeInBytesView &operator=(const EmbossReservedDollarVirtualMinSizeInBytesView &) = |
| default; |
| EmbossReservedDollarVirtualMinSizeInBytesView &operator=(EmbossReservedDollarVirtualMinSizeInBytesView &&) = |
| default; |
| ~EmbossReservedDollarVirtualMinSizeInBytesView() = default; |
| |
| static constexpr ::std::int32_t Read(); |
| static constexpr ::std::int32_t UncheckedRead(); |
| static constexpr bool Ok() { return true; } |
| template <class Stream> |
| void WriteToTextStream(Stream *emboss_reserved_local_stream, |
| const ::emboss::TextOutputOptions |
| &emboss_reserved_local_options) const { |
| ::emboss::support::WriteIntegerViewToTextStream( |
| this, emboss_reserved_local_stream, emboss_reserved_local_options); |
| } |
| |
| static constexpr bool IsAggregate() { return false; } |
| }; |
| |
| static constexpr EmbossReservedDollarVirtualMinSizeInBytesView MinSizeInBytes() { |
| return EmbossReservedDollarVirtualMinSizeInBytesView(); |
| } |
| static constexpr ::emboss::support::Maybe<bool> has_MinSizeInBytes() { |
| return ::emboss::support::Maybe<bool>(true); |
| } |
| |
| |
| |
| private: |
| Storage backing_; |
| |
| |
| |
| template <class OtherStorage> |
| friend class GenericStructWithSkippedStructureFieldsView; |
| }; |
| using StructWithSkippedStructureFieldsView = |
| GenericStructWithSkippedStructureFieldsView</**/ ::emboss::support::ReadOnlyContiguousBuffer>; |
| using StructWithSkippedStructureFieldsWriter = |
| GenericStructWithSkippedStructureFieldsView</**/ ::emboss::support::ReadWriteContiguousBuffer>; |
| |
| template <class View> |
| struct EmbossReservedInternalIsGenericStructWithSkippedStructureFieldsView { |
| static constexpr const bool value = false; |
| }; |
| |
| template <class Storage> |
| struct EmbossReservedInternalIsGenericStructWithSkippedStructureFieldsView< |
| GenericStructWithSkippedStructureFieldsView<Storage>> { |
| static constexpr const bool value = true; |
| }; |
| |
| template <typename T> |
| inline GenericStructWithSkippedStructureFieldsView< |
| /**/ ::emboss::support::ContiguousBuffer< |
| typename ::std::remove_reference< |
| decltype(*::std::declval<T>()->data())>::type, |
| 1, 0>> |
| MakeStructWithSkippedStructureFieldsView( T &&emboss_reserved_local_arg) { |
| return GenericStructWithSkippedStructureFieldsView< |
| /**/ ::emboss::support::ContiguousBuffer< |
| typename ::std::remove_reference<decltype( |
| *::std::declval<T>()->data())>::type, |
| 1, 0>>( |
| ::std::forward<T>(emboss_reserved_local_arg)); |
| } |
| |
| template <typename T> |
| inline GenericStructWithSkippedStructureFieldsView</**/ ::emboss::support::ContiguousBuffer<T, 1, 0>> |
| MakeStructWithSkippedStructureFieldsView( T *emboss_reserved_local_data, |
| ::std::size_t emboss_reserved_local_size) { |
| return GenericStructWithSkippedStructureFieldsView</**/ ::emboss::support::ContiguousBuffer<T, 1, 0>>( |
| emboss_reserved_local_data, |
| emboss_reserved_local_size); |
| } |
| |
| template <typename T, ::std::size_t kAlignment> |
| inline GenericStructWithSkippedStructureFieldsView< |
| /**/ ::emboss::support::ContiguousBuffer<T, kAlignment, 0>> |
| MakeAlignedStructWithSkippedStructureFieldsView( |
| T *emboss_reserved_local_data, |
| ::std::size_t emboss_reserved_local_size) { |
| return GenericStructWithSkippedStructureFieldsView< |
| /**/ ::emboss::support::ContiguousBuffer<T, kAlignment, 0>>( |
| emboss_reserved_local_data, |
| emboss_reserved_local_size); |
| } |
| |
| namespace Vanilla { |
| |
| } // namespace Vanilla |
| |
| |
| template <class Storage> |
| inline typename ::emboss::prelude::UIntView< |
| /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, |
| typename ::emboss::support::BitBlock</**/::emboss::support::NullByteOrderer<typename Storage::template OffsetStorageType</**/0, 0>>, 8>> |
| |
| GenericVanillaView<Storage>::a() |
| const { |
| |
| if ( has_a().ValueOr(false)) { |
| |
| auto emboss_reserved_local_size = ::emboss::support::Maybe</**/::std::int32_t>(static_cast</**/::std::int32_t>(1LL)); |
| auto emboss_reserved_local_offset = ::emboss::support::Maybe</**/::std::int32_t>(static_cast</**/::std::int32_t>(0LL)); |
| if (emboss_reserved_local_size.Known() && |
| emboss_reserved_local_size.ValueOr(0) >= 0 && |
| emboss_reserved_local_offset.Known() && |
| emboss_reserved_local_offset.ValueOr(0) >= 0) { |
| return ::emboss::prelude::UIntView< |
| /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, |
| typename ::emboss::support::BitBlock</**/::emboss::support::NullByteOrderer<typename Storage::template OffsetStorageType</**/0, 0>>, 8>> |
| |
| ( |
| backing_ |
| .template GetOffsetStorage<0, |
| 0>( |
| emboss_reserved_local_offset.ValueOrDefault(), |
| emboss_reserved_local_size.ValueOrDefault())); |
| } |
| } |
| return ::emboss::prelude::UIntView< |
| /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, |
| typename ::emboss::support::BitBlock</**/::emboss::support::NullByteOrderer<typename Storage::template OffsetStorageType</**/0, 0>>, 8>> |
| |
| (); |
| } |
| |
| template <class Storage> |
| inline ::emboss::support::Maybe<bool> |
| GenericVanillaView<Storage>::has_a() const { |
| return ::emboss::support::Maybe</**/bool>(true); |
| } |
| |
| |
| template <class Storage> |
| inline typename ::emboss::prelude::UIntView< |
| /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, |
| typename ::emboss::support::BitBlock</**/::emboss::support::NullByteOrderer<typename Storage::template OffsetStorageType</**/0, 1>>, 8>> |
| |
| GenericVanillaView<Storage>::b() |
| const { |
| |
| if ( has_b().ValueOr(false)) { |
| |
| auto emboss_reserved_local_size = ::emboss::support::Maybe</**/::std::int32_t>(static_cast</**/::std::int32_t>(1LL)); |
| auto emboss_reserved_local_offset = ::emboss::support::Maybe</**/::std::int32_t>(static_cast</**/::std::int32_t>(1LL)); |
| if (emboss_reserved_local_size.Known() && |
| emboss_reserved_local_size.ValueOr(0) >= 0 && |
| emboss_reserved_local_offset.Known() && |
| emboss_reserved_local_offset.ValueOr(0) >= 0) { |
| return ::emboss::prelude::UIntView< |
| /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, |
| typename ::emboss::support::BitBlock</**/::emboss::support::NullByteOrderer<typename Storage::template OffsetStorageType</**/0, 1>>, 8>> |
| |
| ( |
| backing_ |
| .template GetOffsetStorage<0, |
| 1>( |
| emboss_reserved_local_offset.ValueOrDefault(), |
| emboss_reserved_local_size.ValueOrDefault())); |
| } |
| } |
| return ::emboss::prelude::UIntView< |
| /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, |
| typename ::emboss::support::BitBlock</**/::emboss::support::NullByteOrderer<typename Storage::template OffsetStorageType</**/0, 1>>, 8>> |
| |
| (); |
| } |
| |
| template <class Storage> |
| inline ::emboss::support::Maybe<bool> |
| GenericVanillaView<Storage>::has_b() const { |
| return ::emboss::support::Maybe</**/bool>(true); |
| } |
| |
| |
| namespace Vanilla { |
| inline constexpr ::std::int32_t IntrinsicSizeInBytes() { |
| return ::emboss::support::Maybe</**/::std::int32_t>(static_cast</**/::std::int32_t>(2LL)).ValueOrDefault(); |
| } |
| } // namespace Vanilla |
| |
| template <class Storage> |
| inline constexpr ::std::int32_t |
| GenericVanillaView<Storage>::EmbossReservedDollarVirtualIntrinsicSizeInBytesView::Read() { |
| return Vanilla::IntrinsicSizeInBytes(); |
| } |
| |
| template <class Storage> |
| inline constexpr ::std::int32_t |
| GenericVanillaView< |
| Storage>::EmbossReservedDollarVirtualIntrinsicSizeInBytesView::UncheckedRead() { |
| return Vanilla::IntrinsicSizeInBytes(); |
| } |
| |
| namespace Vanilla { |
| inline constexpr ::std::int32_t MaxSizeInBytes() { |
| return ::emboss::support::Maybe</**/::std::int32_t>(static_cast</**/::std::int32_t>(2LL)).ValueOrDefault(); |
| } |
| } // namespace Vanilla |
| |
| template <class Storage> |
| inline constexpr ::std::int32_t |
| GenericVanillaView<Storage>::EmbossReservedDollarVirtualMaxSizeInBytesView::Read() { |
| return Vanilla::MaxSizeInBytes(); |
| } |
| |
| template <class Storage> |
| inline constexpr ::std::int32_t |
| GenericVanillaView< |
| Storage>::EmbossReservedDollarVirtualMaxSizeInBytesView::UncheckedRead() { |
| return Vanilla::MaxSizeInBytes(); |
| } |
| |
| namespace Vanilla { |
| inline constexpr ::std::int32_t MinSizeInBytes() { |
| return ::emboss::support::Maybe</**/::std::int32_t>(static_cast</**/::std::int32_t>(2LL)).ValueOrDefault(); |
| } |
| } // namespace Vanilla |
| |
| template <class Storage> |
| inline constexpr ::std::int32_t |
| GenericVanillaView<Storage>::EmbossReservedDollarVirtualMinSizeInBytesView::Read() { |
| return Vanilla::MinSizeInBytes(); |
| } |
| |
| template <class Storage> |
| inline constexpr ::std::int32_t |
| GenericVanillaView< |
| Storage>::EmbossReservedDollarVirtualMinSizeInBytesView::UncheckedRead() { |
| return Vanilla::MinSizeInBytes(); |
| } |
| namespace StructWithSkippedFields { |
| |
| } // namespace StructWithSkippedFields |
| |
| |
| template <class Storage> |
| inline typename ::emboss::prelude::UIntView< |
| /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, |
| typename ::emboss::support::BitBlock</**/::emboss::support::NullByteOrderer<typename Storage::template OffsetStorageType</**/0, 0>>, 8>> |
| |
| GenericStructWithSkippedFieldsView<Storage>::a() |
| const { |
| |
| if ( has_a().ValueOr(false)) { |
| |
| auto emboss_reserved_local_size = ::emboss::support::Maybe</**/::std::int32_t>(static_cast</**/::std::int32_t>(1LL)); |
| auto emboss_reserved_local_offset = ::emboss::support::Maybe</**/::std::int32_t>(static_cast</**/::std::int32_t>(0LL)); |
| if (emboss_reserved_local_size.Known() && |
| emboss_reserved_local_size.ValueOr(0) >= 0 && |
| emboss_reserved_local_offset.Known() && |
| emboss_reserved_local_offset.ValueOr(0) >= 0) { |
| return ::emboss::prelude::UIntView< |
| /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, |
| typename ::emboss::support::BitBlock</**/::emboss::support::NullByteOrderer<typename Storage::template OffsetStorageType</**/0, 0>>, 8>> |
| |
| ( |
| backing_ |
| .template GetOffsetStorage<0, |
| 0>( |
| emboss_reserved_local_offset.ValueOrDefault(), |
| emboss_reserved_local_size.ValueOrDefault())); |
| } |
| } |
| return ::emboss::prelude::UIntView< |
| /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, |
| typename ::emboss::support::BitBlock</**/::emboss::support::NullByteOrderer<typename Storage::template OffsetStorageType</**/0, 0>>, 8>> |
| |
| (); |
| } |
| |
| template <class Storage> |
| inline ::emboss::support::Maybe<bool> |
| GenericStructWithSkippedFieldsView<Storage>::has_a() const { |
| return ::emboss::support::Maybe</**/bool>(true); |
| } |
| |
| |
| template <class Storage> |
| inline typename ::emboss::prelude::UIntView< |
| /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, |
| typename ::emboss::support::BitBlock</**/::emboss::support::NullByteOrderer<typename Storage::template OffsetStorageType</**/0, 1>>, 8>> |
| |
| GenericStructWithSkippedFieldsView<Storage>::b() |
| const { |
| |
| if ( has_b().ValueOr(false)) { |
| |
| auto emboss_reserved_local_size = ::emboss::support::Maybe</**/::std::int32_t>(static_cast</**/::std::int32_t>(1LL)); |
| auto emboss_reserved_local_offset = ::emboss::support::Maybe</**/::std::int32_t>(static_cast</**/::std::int32_t>(1LL)); |
| if (emboss_reserved_local_size.Known() && |
| emboss_reserved_local_size.ValueOr(0) >= 0 && |
| emboss_reserved_local_offset.Known() && |
| emboss_reserved_local_offset.ValueOr(0) >= 0) { |
| return ::emboss::prelude::UIntView< |
| /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, |
| typename ::emboss::support::BitBlock</**/::emboss::support::NullByteOrderer<typename Storage::template OffsetStorageType</**/0, 1>>, 8>> |
| |
| ( |
| backing_ |
| .template GetOffsetStorage<0, |
| 1>( |
| emboss_reserved_local_offset.ValueOrDefault(), |
| emboss_reserved_local_size.ValueOrDefault())); |
| } |
| } |
| return ::emboss::prelude::UIntView< |
| /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, |
| typename ::emboss::support::BitBlock</**/::emboss::support::NullByteOrderer<typename Storage::template OffsetStorageType</**/0, 1>>, 8>> |
| |
| (); |
| } |
| |
| template <class Storage> |
| inline ::emboss::support::Maybe<bool> |
| GenericStructWithSkippedFieldsView<Storage>::has_b() const { |
| return ::emboss::support::Maybe</**/bool>(true); |
| } |
| |
| |
| template <class Storage> |
| inline typename ::emboss::prelude::UIntView< |
| /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, |
| typename ::emboss::support::BitBlock</**/::emboss::support::NullByteOrderer<typename Storage::template OffsetStorageType</**/0, 2>>, 8>> |
| |
| GenericStructWithSkippedFieldsView<Storage>::c() |
| const { |
| |
| if ( has_c().ValueOr(false)) { |
| |
| auto emboss_reserved_local_size = ::emboss::support::Maybe</**/::std::int32_t>(static_cast</**/::std::int32_t>(1LL)); |
| auto emboss_reserved_local_offset = ::emboss::support::Maybe</**/::std::int32_t>(static_cast</**/::std::int32_t>(2LL)); |
| if (emboss_reserved_local_size.Known() && |
| emboss_reserved_local_size.ValueOr(0) >= 0 && |
| emboss_reserved_local_offset.Known() && |
| emboss_reserved_local_offset.ValueOr(0) >= 0) { |
| return ::emboss::prelude::UIntView< |
| /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, |
| typename ::emboss::support::BitBlock</**/::emboss::support::NullByteOrderer<typename Storage::template OffsetStorageType</**/0, 2>>, 8>> |
| |
| ( |
| backing_ |
| .template GetOffsetStorage<0, |
| 2>( |
| emboss_reserved_local_offset.ValueOrDefault(), |
| emboss_reserved_local_size.ValueOrDefault())); |
| } |
| } |
| return ::emboss::prelude::UIntView< |
| /**/ ::emboss::support::FixedSizeViewParameters<8, ::emboss::support::AllValuesAreOk>, |
| typename ::emboss::support::BitBlock</**/::emboss::support::NullByteOrderer<typename Storage::template OffsetStorageType</**/0, 2>>, 8>> |
| |
| (); |
| } |
| |
| template <class Storage> |
| inline ::emboss::support::Maybe<bool> |
| GenericStructWithSkippedFieldsView<Storage>::has_c() const { |
| return ::emboss::support::Maybe</**/bool>(true); |
| } |
| |
| |
| namespace StructWithSkippedFields { |
| inline constexpr ::std::int32_t IntrinsicSizeInBytes() { |
| return ::emboss::support::Maybe</**/::std::int32_t>(static_cast</**/::std::int32_t>(3LL)).ValueOrDefault(); |
| } |
| } // namespace StructWithSkippedFields |
| |
| template <class Storage> |
| inline constexpr ::std::int32_t |
| GenericStructWithSkippedFieldsView<Storage>::EmbossReservedDollarVirtualIntrinsicSizeInBytesView::Read() { |
| return StructWithSkippedFields::IntrinsicSizeInBytes(); |
| } |
| |
| template <class Storage> |
| inline constexpr ::std::int32_t |
| GenericStructWithSkippedFieldsView< |
| Storage>::EmbossReservedDollarVirtualIntrinsicSizeInBytesView::UncheckedRead() { |
| return StructWithSkippedFields::IntrinsicSizeInBytes(); |
| } |
| |
| namespace StructWithSkippedFields { |
| inline constexpr ::std::int32_t MaxSizeInBytes() { |
| return ::emboss::support::Maybe</**/::std::int32_t>(static_cast</**/::std::int32_t>(3LL)).ValueOrDefault(); |
| } |
| } // namespace StructWithSkippedFields |
| |
| template <class Storage> |
| inline constexpr ::std::int32_t |
| GenericStructWithSkippedFieldsView<Storage>::EmbossReservedDollarVirtualMaxSizeInBytesView::Read() { |
| return StructWithSkippedFields::MaxSizeInBytes(); |
| } |
| |
| template <class Storage> |
| inline constexpr ::std::int32_t |
| GenericStructWithSkippedFieldsView< |
| Storage>::EmbossReservedDollarVirtualMaxSizeInBytesView::UncheckedRead() { |
| return StructWithSkippedFields::MaxSizeInBytes(); |
| } |
| |
| namespace StructWithSkippedFields { |
| inline constexpr ::std::int32_t MinSizeInBytes() { |
| return ::emboss::support::Maybe</**/::std::int32_t>(static_cast</**/::std::int32_t>(3LL)).ValueOrDefault(); |
| } |
| } // namespace StructWithSkippedFields |
| |
| template <class Storage> |
| inline constexpr ::std::int32_t |
| GenericStructWithSkippedFieldsView<Storage>::EmbossReservedDollarVirtualMinSizeInBytesView::Read() { |
| return StructWithSkippedFields::MinSizeInBytes(); |
| } |
| |
| template <class Storage> |
| inline constexpr ::std::int32_t |
| GenericStructWithSkippedFieldsView< |
| Storage>::EmbossReservedDollarVirtualMinSizeInBytesView::UncheckedRead() { |
| return StructWithSkippedFields::MinSizeInBytes(); |
| } |
| namespace StructWithSkippedStructureFields { |
| |
| } // namespace StructWithSkippedStructureFields |
| |
| |
| template <class Storage> |
| inline typename ::emboss::test::GenericVanillaView<typename Storage::template OffsetStorageType</**/0, 0>> |
| |
| GenericStructWithSkippedStructureFieldsView<Storage>::a() |
| const { |
| |
| if ( has_a().ValueOr(false)) { |
| |
| auto emboss_reserved_local_size = ::emboss::support::Maybe</**/::std::int32_t>(static_cast</**/::std::int32_t>(2LL)); |
| auto emboss_reserved_local_offset = ::emboss::support::Maybe</**/::std::int32_t>(static_cast</**/::std::int32_t>(0LL)); |
| if (emboss_reserved_local_size.Known() && |
| emboss_reserved_local_size.ValueOr(0) >= 0 && |
| emboss_reserved_local_offset.Known() && |
| emboss_reserved_local_offset.ValueOr(0) >= 0) { |
| return ::emboss::test::GenericVanillaView<typename Storage::template OffsetStorageType</**/0, 0>> |
| |
| ( |
| backing_ |
| .template GetOffsetStorage<0, |
| 0>( |
| emboss_reserved_local_offset.ValueOrDefault(), |
| emboss_reserved_local_size.ValueOrDefault())); |
| } |
| } |
| return ::emboss::test::GenericVanillaView<typename Storage::template OffsetStorageType</**/0, 0>> |
| |
| (); |
| } |
| |
| template <class Storage> |
| inline ::emboss::support::Maybe<bool> |
| GenericStructWithSkippedStructureFieldsView<Storage>::has_a() const { |
| return ::emboss::support::Maybe</**/bool>(true); |
| } |
| |
| |
| template <class Storage> |
| inline typename ::emboss::test::GenericVanillaView<typename Storage::template OffsetStorageType</**/0, 2>> |
| |
| GenericStructWithSkippedStructureFieldsView<Storage>::b() |
| const { |
| |
| if ( has_b().ValueOr(false)) { |
| |
| auto emboss_reserved_local_size = ::emboss::support::Maybe</**/::std::int32_t>(static_cast</**/::std::int32_t>(2LL)); |
| auto emboss_reserved_local_offset = ::emboss::support::Maybe</**/::std::int32_t>(static_cast</**/::std::int32_t>(2LL)); |
| if (emboss_reserved_local_size.Known() && |
| emboss_reserved_local_size.ValueOr(0) >= 0 && |
| emboss_reserved_local_offset.Known() && |
| emboss_reserved_local_offset.ValueOr(0) >= 0) { |
| return ::emboss::test::GenericVanillaView<typename Storage::template OffsetStorageType</**/0, 2>> |
| |
| ( |
| backing_ |
| .template GetOffsetStorage<0, |
| 2>( |
| emboss_reserved_local_offset.ValueOrDefault(), |
| emboss_reserved_local_size.ValueOrDefault())); |
| } |
| } |
| return ::emboss::test::GenericVanillaView<typename Storage::template OffsetStorageType</**/0, 2>> |
| |
| (); |
| } |
| |
| template <class Storage> |
| inline ::emboss::support::Maybe<bool> |
| GenericStructWithSkippedStructureFieldsView<Storage>::has_b() const { |
| return ::emboss::support::Maybe</**/bool>(true); |
| } |
| |
| |
| template <class Storage> |
| inline typename ::emboss::test::GenericVanillaView<typename Storage::template OffsetStorageType</**/0, 4>> |
| |
| GenericStructWithSkippedStructureFieldsView<Storage>::c() |
| const { |
| |
| if ( has_c().ValueOr(false)) { |
| |
| auto emboss_reserved_local_size = ::emboss::support::Maybe</**/::std::int32_t>(static_cast</**/::std::int32_t>(2LL)); |
| auto emboss_reserved_local_offset = ::emboss::support::Maybe</**/::std::int32_t>(static_cast</**/::std::int32_t>(4LL)); |
| if (emboss_reserved_local_size.Known() && |
| emboss_reserved_local_size.ValueOr(0) >= 0 && |
| emboss_reserved_local_offset.Known() && |
| emboss_reserved_local_offset.ValueOr(0) >= 0) { |
| return ::emboss::test::GenericVanillaView<typename Storage::template OffsetStorageType</**/0, 4>> |
| |
| ( |
| backing_ |
| .template GetOffsetStorage<0, |
| 4>( |
| emboss_reserved_local_offset.ValueOrDefault(), |
| emboss_reserved_local_size.ValueOrDefault())); |
| } |
| } |
| return ::emboss::test::GenericVanillaView<typename Storage::template OffsetStorageType</**/0, 4>> |
| |
| (); |
| } |
| |
| template <class Storage> |
| inline ::emboss::support::Maybe<bool> |
| GenericStructWithSkippedStructureFieldsView<Storage>::has_c() const { |
| return ::emboss::support::Maybe</**/bool>(true); |
| } |
| |
| |
| namespace StructWithSkippedStructureFields { |
| inline constexpr ::std::int32_t IntrinsicSizeInBytes() { |
| return ::emboss::support::Maybe</**/::std::int32_t>(static_cast</**/::std::int32_t>(6LL)).ValueOrDefault(); |
| } |
| } // namespace StructWithSkippedStructureFields |
| |
| template <class Storage> |
| inline constexpr ::std::int32_t |
| GenericStructWithSkippedStructureFieldsView<Storage>::EmbossReservedDollarVirtualIntrinsicSizeInBytesView::Read() { |
| return StructWithSkippedStructureFields::IntrinsicSizeInBytes(); |
| } |
| |
| template <class Storage> |
| inline constexpr ::std::int32_t |
| GenericStructWithSkippedStructureFieldsView< |
| Storage>::EmbossReservedDollarVirtualIntrinsicSizeInBytesView::UncheckedRead() { |
| return StructWithSkippedStructureFields::IntrinsicSizeInBytes(); |
| } |
| |
| namespace StructWithSkippedStructureFields { |
| inline constexpr ::std::int32_t MaxSizeInBytes() { |
| return ::emboss::support::Maybe</**/::std::int32_t>(static_cast</**/::std::int32_t>(6LL)).ValueOrDefault(); |
| } |
| } // namespace StructWithSkippedStructureFields |
| |
| template <class Storage> |
| inline constexpr ::std::int32_t |
| GenericStructWithSkippedStructureFieldsView<Storage>::EmbossReservedDollarVirtualMaxSizeInBytesView::Read() { |
| return StructWithSkippedStructureFields::MaxSizeInBytes(); |
| } |
| |
| template <class Storage> |
| inline constexpr ::std::int32_t |
| GenericStructWithSkippedStructureFieldsView< |
| Storage>::EmbossReservedDollarVirtualMaxSizeInBytesView::UncheckedRead() { |
| return StructWithSkippedStructureFields::MaxSizeInBytes(); |
| } |
| |
| namespace StructWithSkippedStructureFields { |
| inline constexpr ::std::int32_t MinSizeInBytes() { |
| return ::emboss::support::Maybe</**/::std::int32_t>(static_cast</**/::std::int32_t>(6LL)).ValueOrDefault(); |
| } |
| } // namespace StructWithSkippedStructureFields |
| |
| template <class Storage> |
| inline constexpr ::std::int32_t |
| GenericStructWithSkippedStructureFieldsView<Storage>::EmbossReservedDollarVirtualMinSizeInBytesView::Read() { |
| return StructWithSkippedStructureFields::MinSizeInBytes(); |
| } |
| |
| template <class Storage> |
| inline constexpr ::std::int32_t |
| GenericStructWithSkippedStructureFieldsView< |
| Storage>::EmbossReservedDollarVirtualMinSizeInBytesView::UncheckedRead() { |
| return StructWithSkippedStructureFields::MinSizeInBytes(); |
| } |
| |
| |
| |
| } // namespace test |
| |
| |
| |
| } // namespace emboss |
| |
| |
| |
| /* NOLINTEND */ |
| |
| #endif // TESTDATA_TEXT_FORMAT_EMB_H_ |
| |