From 6341ffc3ce64645894339ac17c648faab9db744a Mon Sep 17 00:00:00 2001 From: Aaron Webster Date: Sun, 19 Jul 2026 14:54:45 -0700 Subject: [PATCH] Report `IsComplete()` true for a division-by-zero `$size_in_bytes` Phase C of the `//`/`%` rework. A structure whose intrinsic size divides by zero has an *undefined* size: it can never be `Ok()`, so per the design doc (doc/design_docs/division_and_modulus.md, "IsComplete()") it should report `IsComplete() == true` -- there is nothing more to wait for -- to distinguish it from a structure that is merely short a few bytes. To carry that distinction, `Maybe` gains an `Unknowability` reason (kKnown / kUnreadable / kUndefined) explaining *why* a value is un-Known. A default-constructed `Maybe` is kUnreadable (the common absent/short-field case, so most sites need no change); a `// 0` or `% 0` at runtime is the sole source of kUndefined. The expression operators in emboss_arithmetic.h thread and merge the reason, with operation-dependent precedence: * arithmetic (MaybeDo/Sum/Product/Maximum/comparisons): kUndefined dominates -- an undefined input can never be fixed by more bytes; * short-circuiting And/Or: kUnreadable dominates -- an unreadable operand could still resolve the whole expression with more bytes; * Choice: propagates the condition's reason, or the taken branch's; * `//`/`%`: a Known() zero divisor is kUndefined, else propagates. Generated views gain `Maybe IsUndefined()` (on both the dynamic and constant virtual-field views), and `IsComplete()` returns true when `IntrinsicSizeIn*().IsUndefined()`. Net effect for a `/0` size: `Ok()` false, `IsComplete()` true, `IsUndefined()` true. The reason is a `uint8_t` enum kept fully constexpr to avoid disturbing the size-sensitive `Ok()` path. All C++ goldens regenerate (the shared `Maybe` and virtual-view templates changed); the changes are uniform IsComplete/IsUndefined plumbing. Adds Maybe reason tests, an emboss_arithmetic reason-merge matrix, and IsComplete/IsUndefined integration assertions (including the unreadable-vs-undefined case). --- .../back_end/cpp/generated_code_templates | 36 +- .../cpp/testcode/division_modulus_test.cc | 45 +- doc/cpp-reference.md | 23 + runtime/cpp/emboss_arithmetic.h | 80 +- runtime/cpp/emboss_maybe.h | 55 +- runtime/cpp/test/emboss_arithmetic_test.cc | 185 +++++ runtime/cpp/test/emboss_maybe_test.cc | 44 ++ testdata/golden_cpp/alignments.emb.h | 54 +- testdata/golden_cpp/anonymous_bits.emb.h | 52 +- testdata/golden_cpp/auto_array_size.emb.h | 41 +- testdata/golden_cpp/bcd.emb.h | 53 +- testdata/golden_cpp/bits.emb.h | 135 +++- testdata/golden_cpp/complex_offset.emb.h | 104 ++- testdata/golden_cpp/complex_structure.emb.h | 75 +- testdata/golden_cpp/condition.emb.h | 719 ++++++++++++++---- testdata/golden_cpp/division_modulus.emb.h | 163 +++- testdata/golden_cpp/dynamic_size.emb.h | 243 ++++-- testdata/golden_cpp/enum.emb.h | 77 +- testdata/golden_cpp/enum_case.emb.h | 29 +- testdata/golden_cpp/explicit_sizes.emb.h | 69 +- testdata/golden_cpp/float.emb.h | 36 +- testdata/golden_cpp/imported.emb.h | 18 +- testdata/golden_cpp/imported_genfiles.emb.h | 18 +- testdata/golden_cpp/importer.emb.h | 18 +- testdata/golden_cpp/importer2.emb.h | 18 +- testdata/golden_cpp/inline_type.emb.h | 18 +- testdata/golden_cpp/int_sizes.emb.h | 18 +- testdata/golden_cpp/large_array.emb.h | 23 +- testdata/golden_cpp/many_conditionals.emb.h | 46 +- testdata/golden_cpp/nested_structure.emb.h | 54 +- testdata/golden_cpp/next_keyword.emb.h | 18 +- testdata/golden_cpp/no_enum_traits.emb.h | 18 +- testdata/golden_cpp/parameters.emb.h | 313 ++++++-- testdata/golden_cpp/requires.emb.h | 203 ++++- testdata/golden_cpp/start_size_range.emb.h | 23 +- testdata/golden_cpp/subtypes.emb.h | 80 +- testdata/golden_cpp/text_format.emb.h | 54 +- testdata/golden_cpp/uint_sizes.emb.h | 125 ++- testdata/golden_cpp/virtual_field.emb.h | 583 ++++++++++++-- 39 files changed, 3332 insertions(+), 634 deletions(-) diff --git a/compiler/back_end/cpp/generated_code_templates b/compiler/back_end/cpp/generated_code_templates index 9e2c7818..53767d23 100644 --- a/compiler/back_end/cpp/generated_code_templates +++ b/compiler/back_end/cpp/generated_code_templates @@ -133,11 +133,20 @@ ${requires_check} return true; } Storage BackingStorage() const { return backing_; } + // The intention of IsComplete() is that it returns true iff adding more bytes + // to the backing store cannot change the result of Ok() -- i.e. there are + // enough bytes to hold the structure, even if it is broken in some other way. + // + // If the structure's intrinsic size is *undefined* -- it depends on a dynamic + // value that divides or takes a modulus by zero -- then it can never be Ok(), + // no matter how many bytes are supplied, so there is nothing more to wait for + // and IsComplete() returns true. (Ok() still returns false in that case.) bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeIn${units}().Ok() && - backing_.SizeIn${units}() >= - static_cast( - IntrinsicSizeIn${units}().UncheckedRead()); + return IntrinsicSizeIn${units}().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeIn${units}().Ok() && + backing_.SizeIn${units}() >= + static_cast( + IntrinsicSizeIn${units}().UncheckedRead())); } ${size_method} @@ -565,6 +574,12 @@ Generic${parent_type}View::has_${name}() const { static constexpr ${logical_type} Read(); static constexpr ${logical_type} UncheckedRead(); static constexpr bool Ok() { return true; } + // A constant virtual field always has a defined value, so it is never + // undefined. (Mirrors the dynamic virtual field's IsUndefined() so that + // IsComplete() can query IntrinsicSizeIn*() uniformly.) + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions @@ -668,6 +683,19 @@ Generic${parent_type}View< return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); } + // Distinguishes the two ways this field can fail to have a value. Returns + // a Known() true if the value is *undefined* (the arithmetic divides or + // takes a modulus by zero, so more bytes can never make it readable), a + // Known() false if it has a defined value, or Unknown if it is merely + // *unreadable* for now (more bytes might resolve it either way). + ::emboss::support::Maybe IsUndefined() const { + const auto emboss_reserved_local_value = MaybeRead(); + return emboss_reserved_local_value.Known() + ? ::emboss::support::Maybe(false) + : (emboss_reserved_local_value.IsUndefined() + ? ::emboss::support::Maybe(true) + : ::emboss::support::Maybe()); + } template void WriteToTextStream(Stream *emboss_reserved_local_stream, const ::emboss::TextOutputOptions diff --git a/compiler/back_end/cpp/testcode/division_modulus_test.cc b/compiler/back_end/cpp/testcode/division_modulus_test.cc index 4f0aac45..2a094512 100644 --- a/compiler/back_end/cpp/testcode/division_modulus_test.cc +++ b/compiler/back_end/cpp/testcode/division_modulus_test.cc @@ -100,10 +100,15 @@ TEST(PayloadSizedByDivision, NonzeroDivisor) { ASSERT_TRUE(view.Ok()); EXPECT_EQ(5U, view.SizeInBytes()); EXPECT_EQ(4U, view.payload().ElementCount()); + // A defined size is complete and not undefined. + EXPECT_TRUE(view.IsComplete()); + EXPECT_FALSE(view.IntrinsicSizeInBytes().IsUndefined().ValueOr(false)); } // When the divisor is zero the payload size is undefined, so the structure's -// size is unknown and Ok() is false -- with no division-by-zero UB. +// size is unknown and Ok() is false -- with no division-by-zero UB. Because an +// undefined size can never be made Ok() by adding bytes, IsComplete() is true +// and IntrinsicSizeInBytes().IsUndefined() reports true (Phase C). TEST(PayloadSizedByDivision, ZeroDivisorIsNotOk) { static constexpr ::std::array kBuf = {{ 0x00, // divisor = 0 -> 16 // 0 undefined @@ -113,6 +118,26 @@ TEST(PayloadSizedByDivision, ZeroDivisorIsNotOk) { EXPECT_FALSE(view.Ok()); EXPECT_FALSE(view.SizeIsKnown()); EXPECT_FALSE(view.IntrinsicSizeInBytes().Ok()); + EXPECT_TRUE(view.IsComplete()); + EXPECT_TRUE(view.IntrinsicSizeInBytes().IsUndefined().ValueOr(false)); +} + +// A nonzero divisor whose payload runs past the end of the buffer has a +// *defined* but *unreadable* size: the structure is genuinely short, so +// IsComplete() is false and the size is not undefined. This is the crux of the +// unreadable-vs-undefined distinction Phase C draws. +TEST(PayloadSizedByDivision, NonzeroDivisorTruncatedIsIncomplete) { + static constexpr ::std::array kBuf = {{ + 0x04, // divisor = 4 -> needs 1 + 16 // 4 = 5 bytes... + 0xaa, 0xbb, // ...but only 3 bytes are present. + }}; + auto view = MakePayloadSizedByDivisionView(&kBuf); + EXPECT_FALSE(view.Ok()); + EXPECT_FALSE(view.IsComplete()); + // The size (5) is defined but not readable from a 3-byte buffer; it is not + // undefined. + EXPECT_TRUE(view.IntrinsicSizeInBytes().Ok()); + EXPECT_FALSE(view.IntrinsicSizeInBytes().IsUndefined().ValueOr(false)); } // A field guarded by an existence condition that divides by a field: the @@ -132,15 +157,19 @@ TEST(FieldGatedByDivision, ConditionTrueAndFalse) { EXPECT_FALSE(absent.has_gated().ValueOr(true)); } -// ...and is *undefined* for a zero divisor. The existence condition is Unknown, -// so the field's presence is unknown and Ok() must return false. This is the -// soundness guard for the Ok()/switch discriminant optimization: an undefined -// existence condition must never be folded to a provably-known value. +// ...and is *undefined* for a zero divisor. The existence condition is +// Unknown, so the field's presence is unknown and Ok() must return false. This +// is the soundness guard for the Ok()/switch discriminant optimization: an +// undefined existence condition must never be folded to a provably-known value. TEST(FieldGatedByDivision, ZeroDivisorIsNotOk) { static constexpr ::std::array kBuf = {{0x00, 0x77}}; auto view = MakeFieldGatedByDivisionView(&kBuf); EXPECT_FALSE(view.Ok()); EXPECT_FALSE(view.has_gated().Known()); + // The undefined existence condition makes the structure's size undefined, so + // it can never be Ok() -- IsComplete() is true. + EXPECT_TRUE(view.IsComplete()); + EXPECT_TRUE(view.IntrinsicSizeInBytes().IsUndefined().ValueOr(false)); } // `0 // divisor` collapses to the single value {0}, but must not be folded to a @@ -156,8 +185,12 @@ TEST(CollapsingQuotient, DefinedForNonzeroDivisor) { TEST(CollapsingQuotient, UndefinedForZeroDivisor) { static constexpr ::std::array kBuf = {{0x00}}; auto view = MakeCollapsingQuotientView(&kBuf); - // The accessor is Unknown -- not a bogus literal 0. + // The accessor is Unknown -- not a bogus literal 0 -- and specifically + // undefined (division by zero), not merely unreadable. EXPECT_FALSE(view.zero_or_undefined().Ok()); + EXPECT_TRUE(view.zero_or_undefined().IsUndefined().ValueOr(false)); + // The struct itself has a constant size (1 byte), so it is always complete. + EXPECT_TRUE(view.IsComplete()); } } // namespace diff --git a/doc/cpp-reference.md b/doc/cpp-reference.md index d480d617..1e6d224e 100644 --- a/doc/cpp-reference.md +++ b/doc/cpp-reference.md @@ -159,6 +159,13 @@ store to fully contain the `struct`. If `IsComplete()` returns `true` but `Ok()` returns `false`, then the structure is broken in some way that cannot be fixed by adding more bytes. +If the `struct`'s intrinsic size is *undefined* -- it depends on a dynamic +value that is divided by zero (or a modulus by zero), as reported by +[`IntrinsicSizeInBytes().IsUndefined()`](#intrinsicsizeinbytes-method) -- then +the `struct` can never be `Ok()`, no matter how many bytes are supplied. In +that case there is nothing more to wait for, so `IsComplete()` returns `true` +(while `Ok()` returns `false`). + ### `IntrinsicSizeInBytes` method @@ -198,6 +205,22 @@ constexpr std::uint64_t view_size = StructView::IntrinsicSizeInBytes().Read(); constexpr std::uint64_t view_size2 = Struct::IntrinsicSizeInBytes(); ``` +The result of `IntrinsicSizeInBytes()` (like any virtual [field +method](#struct-field-methods)) also provides an `IsUndefined` method: + +```c++ +::emboss::support::Maybe IsUndefined() const; +``` + +`IsUndefined().ValueOr(false)` is `true` when the size cannot be read because +the size expression is *undefined* -- currently, because it involves an integer +division or modulus by zero. This is distinct from a size that is merely +*unreadable* (not enough bytes yet): a `Known()` `false` means the size is +defined, a `Known()` `true` means it is undefined and can never be read, and an +un-`Known()` result means the size cannot be read yet but more bytes might make +it either defined or undefined. `IsComplete()` uses this to report `true` for a +`struct` whose size is undefined. + ### `MaxSizeInBytes` method diff --git a/runtime/cpp/emboss_arithmetic.h b/runtime/cpp/emboss_arithmetic.h index ef57b8e0..af7e0d7d 100644 --- a/runtime/cpp/emboss_arithmetic.h +++ b/runtime/cpp/emboss_arithmetic.h @@ -82,6 +82,27 @@ inline constexpr bool AllKnown() { return true; } // This reduces stack frames by ~64x. #include "emboss_arithmetic_all_known_generated.h" +// AnyUndefined(...) returns true if any of its (Maybe<>) arguments +// IsUndefined(). It is only ever evaluated on the un-Known() branch of an +// operation (see MaybeDo), so its cost -- and its worst-case linear recursion, +// mirroring the concern documented for AllKnown above -- never lands on the +// hot, all-Known() Ok() path. The base case is no arguments. +inline constexpr bool AnyUndefined() { return false; } + +template +inline constexpr bool AnyUndefined(Maybe v, RestT... rest) { + return v.IsUndefined() || AnyUndefined(rest...); +} + +// When an ordinary (total) arithmetic operation has an un-Known() result, the +// reason is kUndefined if any operand was undefined -- an undefined input can +// never be fixed by supplying more bytes -- and kUnreadable otherwise. +template +inline constexpr Unknowability ArithmeticUnknowability(Maybe... args) { + return AnyUndefined(args...) ? Unknowability::kUndefined + : Unknowability::kUnreadable; +} + // MaybeDo implements the logic of checking for known values, unwrapping the // known values, passing the unwrapped values to OperatorT, and then rewrapping // the result. @@ -91,7 +112,7 @@ inline constexpr Maybe MaybeDo(Maybe... args) { return AllKnown(args...) ? Maybe(static_cast(OperatorT::template Do<>( static_cast(args.ValueOrDefault())...))) - : Maybe(); + : Maybe(ArithmeticUnknowability(args...)); } //// Operations intended to be passed to MaybeDo: @@ -307,6 +328,20 @@ inline constexpr bool AssertBooleanOperationTypes() { return true; // A literal return type is required for a constexpr function. } +// When a short-circuiting boolean operation (And/Or) has an un-Known() result, +// the reason merge is the *opposite* of arithmetic: kUnreadable dominates +// kUndefined. In `And(undefined, unreadable)`, supplying more bytes could +// still resolve the unreadable operand to Known() false, which would make the +// whole And a Known() false -- so the result is not yet doomed, and its reason +// is kUnreadable. Only when *no* operand can still be settled by more bytes +// (i.e. no operand is kUnreadable) is the short-circuited result kUndefined. +inline constexpr Unknowability BooleanUnknowability(Unknowability l, + Unknowability r) { + return l == Unknowability::kUnreadable || r == Unknowability::kUnreadable + ? Unknowability::kUnreadable + : Unknowability::kUndefined; +} + template inline constexpr Maybe And(Maybe l, Maybe r) { @@ -316,8 +351,10 @@ inline constexpr Maybe And(Maybe l, Maybe r) { return AssertBooleanOperationTypes(), !l.ValueOr(true) || !r.ValueOr(true) ? Maybe(false) - : (!l.Known() || !r.Known() ? Maybe() - : Maybe(true)); + : (!l.Known() || !r.Known() + ? Maybe(BooleanUnknowability(l.Reason(), + r.Reason())) + : Maybe(true)); } template Or(Maybe l, Maybe r) { return AssertBooleanOperationTypes(), l.ValueOr(false) || r.ValueOr(false) ? Maybe(true) - : (!l.Known() || !r.Known() ? Maybe() - : Maybe(false)); + : (!l.Known() || !r.Known() + ? Maybe(BooleanUnknowability(l.Reason(), + r.Reason())) + : Maybe(false)); } template inline constexpr Maybe MaybeStaticCast(Maybe value) { + // A cast changes only the representation, never the readability, of a value, + // so an un-Known() result carries the operand's reason unchanged. This is + // also how Choice() forwards the reason of whichever branch it takes. return value.Known() ? Maybe(static_cast(value.ValueOrDefault())) - : Maybe(); + : Maybe(value.Reason()); } template Choice(Maybe condition, // integral types, ResultT may differ from TrueT or FalseT, so Known() results // must be unwrapped, cast to ResultT, and re-wrapped in Maybe. For // non-integral TrueT/FalseT/ResultT, the cast is unnecessary, but safe. + // If the condition is un-Known(), the result carries the condition's reason. + // If the condition is Known(), MaybeStaticCast forwards the reason of the + // taken branch (kUndefined or kUnreadable), so an undefined-but-not-taken + // branch never poisons the result. return condition.Known() ? condition.ValueOrDefault() ? MaybeStaticCast(if_true) : MaybeStaticCast(if_false) - : Maybe(); + : Maybe(condition.Reason()); +} + +// Computes the reason a `//` or `%` produced an un-Known() result. A Known() +// zero divisor is the one true source of kUndefined: `x // 0` is undefined and +// no amount of additional bytes can change that. Otherwise (some operand is +// itself un-Known()) the reason propagates arithmetic-style: kUndefined if an +// operand is already undefined, else kUnreadable. Note IntermediateT{0} is +// only compared when r.Known(), so an un-Known() r never spuriously reads as a +// zero divisor. +template +inline constexpr Unknowability DivideOrModuloUnknowability(Maybe l, + Maybe r) { + return (r.Known() && + static_cast(r.ValueOrDefault()) == IntermediateT{0}) + ? Unknowability::kUndefined + : (l.IsUndefined() || r.IsUndefined()) ? Unknowability::kUndefined + : Unknowability::kUnreadable; } // MaybeDivideOrModulo implements the shared logic for `//` and `%`: like @@ -376,7 +439,8 @@ inline constexpr Maybe MaybeDivideOrModulo(Maybe l, Maybe r) { return (!l.Known() || !r.Known() || static_cast(r.ValueOrDefault()) == IntermediateT{0}) - ? Maybe() + ? Maybe( + DivideOrModuloUnknowability(l, r)) : Maybe(static_cast(OperatorT::template Do<>( static_cast(l.ValueOrDefault()), static_cast(r.ValueOrDefault())))); diff --git a/runtime/cpp/emboss_maybe.h b/runtime/cpp/emboss_maybe.h index 6c98237d..f425272e 100644 --- a/runtime/cpp/emboss_maybe.h +++ b/runtime/cpp/emboss_maybe.h @@ -24,6 +24,28 @@ namespace emboss { // TODO(bolms): Should Maybe be a public type (i.e., live in ::emboss)? namespace support { +// Unknowability records *why* a Maybe has no value. For the vast majority +// of Unknown values -- an absent field, a short backing buffer, a false +// existence condition -- the value is merely `kUnreadable`: reading more bytes +// could still produce a Known() value. A value is `kUndefined` when it can +// never become Known() no matter how many bytes are supplied, because the +// expression that produced it is mathematically undefined (currently only +// integer division or modulus by zero). +// +// This distinction is what lets a structure whose `$size_in_bytes` divides by +// zero report `IsComplete() == true` (there is nothing more to wait for) while +// still reporting `Ok() == false`. See emboss_arithmetic.h for how the reason +// is propagated and merged through the expression operators, and +// doc/design_docs/division_and_modulus.md for the rationale. +// +// The reason is kept a single byte and every accessor is constexpr so that it +// does not disturb the heavily-constexpr, size-sensitive Ok() code path. +enum class Unknowability : unsigned char { + kKnown, // The Maybe has a value; Known() is true. + kUnreadable, // No value yet, but more bytes could supply one. + kUndefined, // No value ever; the producing expression is undefined. +}; + // Maybe is similar to, but much more restricted than, C++17's std::optional. // It is intended for use in Emboss's expression system, wherein a non-Known() // Maybe will usually (but not always) poison the result of an operation. @@ -33,30 +55,49 @@ namespace support { template class Maybe final { public: - constexpr Maybe() : value_(), known_(false) {} + // A default-constructed Maybe is Unknown for the ordinary `kUnreadable` + // reason. This is by far the most common Unknown (an unreadable field), so + // most Unknown-constructing sites -- field reads, absent parameters -- need + // no change to get the right reason. + constexpr Maybe() : value_(), unknowability_(Unknowability::kUnreadable) {} constexpr explicit Maybe(T value) - : value_(::std::move(value)), known_(true) {} + : value_(::std::move(value)), unknowability_(Unknowability::kKnown) {} + // Constructs an Unknown Maybe with an explicit reason. Callers must pass a + // non-kKnown reason (there is no value to hold); passing kKnown would produce + // a nominally-Known() Maybe with a default-initialized value. + constexpr explicit Maybe(Unknowability unknowability) + : value_(), unknowability_(unknowability) {} constexpr Maybe(const Maybe &) = default; ~Maybe() = default; Maybe &operator=(const Maybe &) = default; Maybe &operator=(T value) { value_ = ::std::move(value); - known_ = true; + unknowability_ = Unknowability::kKnown; return *this; } Maybe &operator=(const T &value) { value_ = value; - known_ = true; + unknowability_ = Unknowability::kKnown; return *this; } - constexpr bool Known() const { return known_; } + constexpr bool Known() const { + return unknowability_ == Unknowability::kKnown; + } + // True iff this Maybe is Unknown specifically because its value is undefined + // (division/modulus by zero) rather than merely unreadable. + constexpr bool IsUndefined() const { + return unknowability_ == Unknowability::kUndefined; + } + // The reason this Maybe has (or has not) a value. Used by the expression + // operators to merge reasons when combining operands. + constexpr Unknowability Reason() const { return unknowability_; } T Value() const { EMBOSS_CHECK(Known()); return value_; } constexpr T ValueOr(T default_value) const { - return known_ ? value_ : default_value; + return Known() ? value_ : default_value; } // A non-Ok() Maybe value-initializes value_ to a default (by explicitly // calling the nullary constructor on value_ in the initializer list), so it @@ -67,7 +108,7 @@ class Maybe final { private: T value_; - bool known_; + Unknowability unknowability_; }; } // namespace support diff --git a/runtime/cpp/test/emboss_arithmetic_test.cc b/runtime/cpp/test/emboss_arithmetic_test.cc index d55851ee..0c73a082 100644 --- a/runtime/cpp/test/emboss_arithmetic_test.cc +++ b/runtime/cpp/test/emboss_arithmetic_test.cc @@ -473,6 +473,191 @@ TEST(Maximum, Maximum) { EXPECT_EQ(Maybe(), (Maximum(Maybe()))); } +// The tests below exercise the "why not" reason (Unknowability) that a +// non-Known Maybe carries, and -- crucially -- how it MERGES across operators. +// The precedence is operation-dependent (see emboss_arithmetic.h): arithmetic +// lets kUndefined dominate, while short-circuiting And/Or let kUnreadable +// dominate. +// +// The test-local operator==(Maybe, Maybe) above ignores the reason, so these +// tests assert on Reason()/IsUndefined() directly. + +// Reason shorthands. A Known() value, an unreadable Unknown, and an undefined +// Unknown, for both int and bool. +constexpr Maybe kKnownInt = Maybe(5); +constexpr Maybe kUnreadableInt = Maybe(); +constexpr Maybe kUndefinedInt = Maybe(Unknowability::kUndefined); +constexpr Maybe kTrue = Maybe(true); +constexpr Maybe kFalse = Maybe(false); +constexpr Maybe kUnreadableBool = Maybe(); +constexpr Maybe kUndefinedBool = Maybe(Unknowability::kUndefined); + +// Operator function templates cannot be aliased, so these helper wrappers give +// the merge-matrix tests below a concise, fixed-type spelling of each operator. +inline Maybe SumII(Maybe l, Maybe r) { + return Sum(l, r); +} +inline Maybe MaxI5(Maybe a, Maybe b, Maybe c, Maybe d, + Maybe e) { + return Maximum(a, b, c, d, e); +} +inline Maybe AndBB(Maybe l, Maybe r) { + return And(l, r); +} +inline Maybe OrBB(Maybe l, Maybe r) { + return Or(l, r); +} +inline Maybe ChoiceI(Maybe c, Maybe t, Maybe f) { + return Choice(c, t, f); +} +inline Maybe QuotII(Maybe l, Maybe r) { + return FlooringQuotient(l, r); +} +inline Maybe RemII(Maybe l, Maybe r) { + return FlooringRemainder(l, r); +} + +TEST(Unknowability, ArithmeticUndefinedDominates) { + // Any undefined operand makes an (un-Known) arithmetic result undefined; + // otherwise an un-Known result is merely unreadable. A fully-Known result + // has no un-Known reason at all. + EXPECT_EQ(Unknowability::kKnown, SumII(kKnownInt, kKnownInt).Reason()); + EXPECT_EQ(Unknowability::kUnreadable, + SumII(kKnownInt, kUnreadableInt).Reason()); + EXPECT_EQ(Unknowability::kUndefined, + SumII(kKnownInt, kUndefinedInt).Reason()); + EXPECT_EQ(Unknowability::kUndefined, + SumII(kUndefinedInt, kUnreadableInt).Reason()); + EXPECT_EQ(Unknowability::kUnreadable, + SumII(kUnreadableInt, kUnreadableInt).Reason()); + EXPECT_TRUE(SumII(kKnownInt, kUndefinedInt).IsUndefined()); + EXPECT_FALSE(SumII(kKnownInt, kUnreadableInt).IsUndefined()); + + // Product and the comparisons route through the same MaybeDo path. + EXPECT_EQ(Unknowability::kUndefined, + (Product(kUndefinedInt, kKnownInt)).Reason()); + EXPECT_EQ( + Unknowability::kUndefined, + (Equal(kUndefinedInt, kKnownInt)).Reason()); + EXPECT_EQ( + Unknowability::kUnreadable, + (LessThan(kUnreadableInt, kKnownInt)).Reason()); +} + +TEST(Unknowability, MaximumUndefinedDominatesAcrossManyArgs) { + // Maximum folds through MaybeDo variadically: a single undefined arg among + // many poisons the whole max as undefined. + EXPECT_EQ( + Unknowability::kUndefined, + MaxI5(kKnownInt, kKnownInt, kUndefinedInt, kKnownInt, kUnreadableInt) + .Reason()); + EXPECT_EQ( + Unknowability::kUnreadable, + MaxI5(kKnownInt, kUnreadableInt, kKnownInt, kKnownInt, kKnownInt) + .Reason()); + EXPECT_EQ( + Unknowability::kKnown, + MaxI5(kKnownInt, kKnownInt, kKnownInt, kKnownInt, kKnownInt).Reason()); +} + +TEST(Unknowability, AndUnreadableDominates) { + // In a short-circuiting And, an unreadable operand could still become a Known + // false with more bytes -- resolving the whole And -- so kUnreadable + // dominates kUndefined. A Known false still short-circuits to Known false. + // + // unreadable + undefined -> unreadable (unreadable side might yet settle). + EXPECT_EQ(Unknowability::kUnreadable, + AndBB(kUndefinedBool, kUnreadableBool).Reason()); + EXPECT_EQ(Unknowability::kUnreadable, + AndBB(kUnreadableBool, kUndefinedBool).Reason()); + // Both undefined -> nothing can settle it -> undefined. + EXPECT_EQ(Unknowability::kUndefined, + AndBB(kUndefinedBool, kUndefinedBool).Reason()); + // A settled (Known true) side plus an undefined side -> undefined. + EXPECT_EQ(Unknowability::kUndefined, AndBB(kTrue, kUndefinedBool).Reason()); + EXPECT_EQ(Unknowability::kUnreadable, AndBB(kTrue, kUnreadableBool).Reason()); + // A Known false short-circuits regardless of the other side's reason. + EXPECT_EQ(Unknowability::kKnown, AndBB(kFalse, kUndefinedBool).Reason()); + EXPECT_TRUE(AndBB(kFalse, kUndefinedBool).Known()); + EXPECT_FALSE(AndBB(kFalse, kUndefinedBool).ValueOrDefault()); +} + +TEST(Unknowability, OrUnreadableDominates) { + // Symmetric to And: an unreadable operand could still become a Known true, + // resolving the Or, so kUnreadable dominates. A Known true short-circuits. + EXPECT_EQ(Unknowability::kUnreadable, + OrBB(kUndefinedBool, kUnreadableBool).Reason()); + EXPECT_EQ(Unknowability::kUndefined, + OrBB(kUndefinedBool, kUndefinedBool).Reason()); + // A settled (Known false) side plus an undefined side -> undefined. + EXPECT_EQ(Unknowability::kUndefined, OrBB(kFalse, kUndefinedBool).Reason()); + EXPECT_EQ(Unknowability::kUnreadable, OrBB(kFalse, kUnreadableBool).Reason()); + // A Known true short-circuits regardless of the other side's reason. + EXPECT_EQ(Unknowability::kKnown, OrBB(kTrue, kUndefinedBool).Reason()); + EXPECT_TRUE(OrBB(kTrue, kUndefinedBool).ValueOrDefault()); +} + +TEST(Unknowability, ChoicePropagatesConditionThenTakenBranch) { + // Unknown condition -> propagate the condition's reason. + EXPECT_EQ(Unknowability::kUndefined, + ChoiceI(kUndefinedBool, kKnownInt, kKnownInt).Reason()); + EXPECT_EQ(Unknowability::kUnreadable, + ChoiceI(kUnreadableBool, kKnownInt, kKnownInt).Reason()); + // Known condition -> propagate ONLY the taken branch's reason; the untaken + // branch's undefined-ness is irrelevant. + EXPECT_EQ(Unknowability::kUndefined, + ChoiceI(kTrue, kUndefinedInt, kKnownInt).Reason()); + EXPECT_EQ(Unknowability::kKnown, + ChoiceI(kTrue, kKnownInt, kUndefinedInt).Reason()); + EXPECT_EQ(Unknowability::kKnown, + ChoiceI(kFalse, kUndefinedInt, kKnownInt).Reason()); + EXPECT_EQ(Unknowability::kUndefined, + ChoiceI(kFalse, kKnownInt, kUndefinedInt).Reason()); + EXPECT_EQ(Unknowability::kUnreadable, + ChoiceI(kTrue, kUnreadableInt, kKnownInt).Reason()); +} + +TEST(Unknowability, MaybeStaticCastPropagates) { + EXPECT_EQ( + Unknowability::kUndefined, + (MaybeStaticCast(kUndefinedInt)).Reason()); + EXPECT_EQ( + Unknowability::kUnreadable, + (MaybeStaticCast(kUnreadableInt)).Reason()); + EXPECT_EQ(Unknowability::kKnown, + (MaybeStaticCast(kKnownInt)).Reason()); +} + +TEST(Unknowability, DivideOrModuloZeroDivisorIsUndefined) { + // A Known zero divisor is undefined -- even if the dividend is unreadable, + // the r==0 case dominates. + EXPECT_EQ(Unknowability::kUndefined, + QuotII(Maybe(8), Maybe(0)).Reason()); + EXPECT_EQ(Unknowability::kUndefined, + RemII(Maybe(8), Maybe(0)).Reason()); + EXPECT_EQ(Unknowability::kUndefined, + QuotII(kUnreadableInt, Maybe(0)).Reason()); + EXPECT_TRUE(QuotII(Maybe(8), Maybe(0)).IsUndefined()); + + // An unreadable operand with a nonzero (or unreadable) divisor is unreadable. + EXPECT_EQ(Unknowability::kUnreadable, + QuotII(Maybe(8), kUnreadableInt).Reason()); + EXPECT_EQ(Unknowability::kUnreadable, + QuotII(kUnreadableInt, Maybe(2)).Reason()); + + // An already-undefined operand propagates as undefined. + EXPECT_EQ(Unknowability::kUndefined, + QuotII(kUndefinedInt, Maybe(2)).Reason()); + EXPECT_EQ(Unknowability::kUndefined, + QuotII(Maybe(8), kUndefinedInt).Reason()); + EXPECT_EQ(Unknowability::kUndefined, + QuotII(kUndefinedInt, kUnreadableInt).Reason()); + + // A defined division has a Known result and no reason. + EXPECT_EQ(Unknowability::kKnown, + QuotII(Maybe(8), Maybe(2)).Reason()); +} + } // namespace test } // namespace support } // namespace emboss diff --git a/runtime/cpp/test/emboss_maybe_test.cc b/runtime/cpp/test/emboss_maybe_test.cc index 3fdc7da7..9c698d65 100644 --- a/runtime/cpp/test/emboss_maybe_test.cc +++ b/runtime/cpp/test/emboss_maybe_test.cc @@ -58,6 +58,50 @@ TEST(Maybe, Unknown) { EXPECT_FALSE(y.Known()); } +TEST(Maybe, Unknowability) { + // A default-constructed Maybe is Unknown for the ordinary kUnreadable reason. + EXPECT_EQ(Unknowability::kUnreadable, Maybe().Reason()); + EXPECT_FALSE(Maybe().IsUndefined()); + + // A value-carrying Maybe is kKnown and never undefined. + EXPECT_EQ(Unknowability::kKnown, Maybe(10).Reason()); + EXPECT_FALSE(Maybe(10).IsUndefined()); + + // The reason constructor records why the value is missing. + EXPECT_EQ(Unknowability::kUndefined, + Maybe(Unknowability::kUndefined).Reason()); + EXPECT_TRUE(Maybe(Unknowability::kUndefined).IsUndefined()); + EXPECT_FALSE(Maybe(Unknowability::kUndefined).Known()); + EXPECT_EQ(Unknowability::kUnreadable, + Maybe(Unknowability::kUnreadable).Reason()); + EXPECT_FALSE(Maybe(Unknowability::kUnreadable).IsUndefined()); + + // These are all constexpr. + static_assert(Maybe().Reason() == Unknowability::kUnreadable, ""); + static_assert(Maybe(Unknowability::kUndefined).IsUndefined(), ""); + static_assert(!Maybe(5).IsUndefined(), ""); +} + +TEST(Maybe, CopyAndAssignPreserveReason) { + // Copy construction preserves the reason. + Maybe undefined = Maybe(Unknowability::kUndefined); + Maybe copy = undefined; + EXPECT_TRUE(copy.IsUndefined()); + + // Copy assignment preserves the reason. + Maybe assigned = Maybe(7); + assigned = undefined; + EXPECT_TRUE(assigned.IsUndefined()); + EXPECT_FALSE(assigned.Known()); + + // Assigning a Known Maybe overwrites the reason back to kKnown. + assigned = Maybe(42); + EXPECT_TRUE(assigned.Known()); + EXPECT_FALSE(assigned.IsUndefined()); + EXPECT_EQ(Unknowability::kKnown, assigned.Reason()); + EXPECT_EQ(42, assigned.Value()); +} + } // namespace test } // namespace support } // namespace emboss diff --git a/testdata/golden_cpp/alignments.emb.h b/testdata/golden_cpp/alignments.emb.h index 89a18e86..ab08eaf9 100644 --- a/testdata/golden_cpp/alignments.emb.h +++ b/testdata/golden_cpp/alignments.emb.h @@ -140,10 +140,11 @@ class GenericAlignmentsView final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBytes().Ok() && - backing_.SizeInBytes() >= - static_cast( - IntrinsicSizeInBytes().UncheckedRead()); + return IntrinsicSizeInBytes().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBytes().Ok() && + backing_.SizeInBytes() >= + static_cast( + IntrinsicSizeInBytes().UncheckedRead())); } static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); @@ -1142,6 +1143,9 @@ class GenericAlignmentsView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -1180,6 +1184,9 @@ class GenericAlignmentsView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -1218,6 +1225,9 @@ class GenericAlignmentsView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -1355,10 +1365,11 @@ class GenericPlaceholder4View final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBytes().Ok() && - backing_.SizeInBytes() >= - static_cast( - IntrinsicSizeInBytes().UncheckedRead()); + return IntrinsicSizeInBytes().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBytes().Ok() && + backing_.SizeInBytes() >= + static_cast( + IntrinsicSizeInBytes().UncheckedRead())); } static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); @@ -1544,6 +1555,9 @@ class GenericPlaceholder4View final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -1582,6 +1596,9 @@ class GenericPlaceholder4View final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -1620,6 +1637,9 @@ class GenericPlaceholder4View final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -1761,10 +1781,11 @@ class GenericPlaceholder6View final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBytes().Ok() && - backing_.SizeInBytes() >= - static_cast( - IntrinsicSizeInBytes().UncheckedRead()); + return IntrinsicSizeInBytes().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBytes().Ok() && + backing_.SizeInBytes() >= + static_cast( + IntrinsicSizeInBytes().UncheckedRead())); } static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); @@ -2017,6 +2038,9 @@ class GenericPlaceholder6View final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -2055,6 +2079,9 @@ class GenericPlaceholder6View final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -2093,6 +2120,9 @@ class GenericPlaceholder6View final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& diff --git a/testdata/golden_cpp/anonymous_bits.emb.h b/testdata/golden_cpp/anonymous_bits.emb.h index d80b0412..f93ca3e3 100644 --- a/testdata/golden_cpp/anonymous_bits.emb.h +++ b/testdata/golden_cpp/anonymous_bits.emb.h @@ -117,9 +117,11 @@ class GenericEmbossReservedAnonymousField2View final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBits().Ok() && - backing_.SizeInBits() >= static_cast( - IntrinsicSizeInBits().UncheckedRead()); + return IntrinsicSizeInBits().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBits().Ok() && + backing_.SizeInBits() >= + static_cast( + IntrinsicSizeInBits().UncheckedRead())); } static constexpr ::std::size_t SizeInBits() { return static_cast(IntrinsicSizeInBits().Read()); @@ -448,6 +450,9 @@ class GenericEmbossReservedAnonymousField2View final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -486,6 +491,9 @@ class GenericEmbossReservedAnonymousField2View final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -524,6 +532,9 @@ class GenericEmbossReservedAnonymousField2View final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -762,9 +773,11 @@ class GenericEmbossReservedAnonymousField1View final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBits().Ok() && - backing_.SizeInBits() >= static_cast( - IntrinsicSizeInBits().UncheckedRead()); + return IntrinsicSizeInBits().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBits().Ok() && + backing_.SizeInBits() >= + static_cast( + IntrinsicSizeInBits().UncheckedRead())); } static constexpr ::std::size_t SizeInBits() { return static_cast(IntrinsicSizeInBits().Read()); @@ -1019,6 +1032,9 @@ class GenericEmbossReservedAnonymousField1View final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -1057,6 +1073,9 @@ class GenericEmbossReservedAnonymousField1View final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -1095,6 +1114,9 @@ class GenericEmbossReservedAnonymousField1View final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -1258,10 +1280,11 @@ class GenericFooView final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBytes().Ok() && - backing_.SizeInBytes() >= - static_cast( - IntrinsicSizeInBytes().UncheckedRead()); + return IntrinsicSizeInBytes().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBytes().Ok() && + backing_.SizeInBytes() >= + static_cast( + IntrinsicSizeInBytes().UncheckedRead())); } static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); @@ -1697,6 +1720,9 @@ class GenericFooView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -1735,6 +1761,9 @@ class GenericFooView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -1773,6 +1802,9 @@ class GenericFooView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& diff --git a/testdata/golden_cpp/auto_array_size.emb.h b/testdata/golden_cpp/auto_array_size.emb.h index a2ba5409..d1f35b28 100644 --- a/testdata/golden_cpp/auto_array_size.emb.h +++ b/testdata/golden_cpp/auto_array_size.emb.h @@ -93,10 +93,11 @@ class GenericElementView final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBytes().Ok() && - backing_.SizeInBytes() >= - static_cast( - IntrinsicSizeInBytes().UncheckedRead()); + return IntrinsicSizeInBytes().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBytes().Ok() && + backing_.SizeInBytes() >= + static_cast( + IntrinsicSizeInBytes().UncheckedRead())); } static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); @@ -358,6 +359,9 @@ class GenericElementView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -396,6 +400,9 @@ class GenericElementView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -434,6 +441,9 @@ class GenericElementView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -585,10 +595,11 @@ class GenericAutoSizeView final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBytes().Ok() && - backing_.SizeInBytes() >= - static_cast( - IntrinsicSizeInBytes().UncheckedRead()); + return IntrinsicSizeInBytes().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBytes().Ok() && + backing_.SizeInBytes() >= + static_cast( + IntrinsicSizeInBytes().UncheckedRead())); } ::std::size_t SizeInBytes() const { return static_cast(IntrinsicSizeInBytes().Read()); @@ -1128,6 +1139,14 @@ class GenericAutoSizeView final { return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); } + ::emboss::support::Maybe IsUndefined() const { + const auto emboss_reserved_local_value = MaybeRead(); + return emboss_reserved_local_value.Known() + ? ::emboss::support::Maybe(false) + : (emboss_reserved_local_value.IsUndefined() + ? ::emboss::support::Maybe(true) + : ::emboss::support::Maybe()); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -1224,6 +1243,9 @@ class GenericAutoSizeView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -1262,6 +1284,9 @@ class GenericAutoSizeView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& diff --git a/testdata/golden_cpp/bcd.emb.h b/testdata/golden_cpp/bcd.emb.h index db1f2f5b..32a962f0 100644 --- a/testdata/golden_cpp/bcd.emb.h +++ b/testdata/golden_cpp/bcd.emb.h @@ -116,9 +116,11 @@ class GenericEmbossReservedAnonymousField1View final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBits().Ok() && - backing_.SizeInBits() >= static_cast( - IntrinsicSizeInBits().UncheckedRead()); + return IntrinsicSizeInBits().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBits().Ok() && + backing_.SizeInBits() >= + static_cast( + IntrinsicSizeInBits().UncheckedRead())); } static constexpr ::std::size_t SizeInBits() { return static_cast(IntrinsicSizeInBits().Read()); @@ -519,6 +521,9 @@ class GenericEmbossReservedAnonymousField1View final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -557,6 +562,9 @@ class GenericEmbossReservedAnonymousField1View final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -595,6 +603,9 @@ class GenericEmbossReservedAnonymousField1View final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -772,10 +783,11 @@ class GenericBcdSizesView final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBytes().Ok() && - backing_.SizeInBytes() >= - static_cast( - IntrinsicSizeInBytes().UncheckedRead()); + return IntrinsicSizeInBytes().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBytes().Ok() && + backing_.SizeInBytes() >= + static_cast( + IntrinsicSizeInBytes().UncheckedRead())); } static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); @@ -1728,6 +1740,9 @@ class GenericBcdSizesView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -1766,6 +1781,9 @@ class GenericBcdSizesView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -1804,6 +1822,9 @@ class GenericBcdSizesView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -1940,10 +1961,11 @@ class GenericBcdBigEndianView final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBytes().Ok() && - backing_.SizeInBytes() >= - static_cast( - IntrinsicSizeInBytes().UncheckedRead()); + return IntrinsicSizeInBytes().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBytes().Ok() && + backing_.SizeInBytes() >= + static_cast( + IntrinsicSizeInBytes().UncheckedRead())); } static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); @@ -2129,6 +2151,9 @@ class GenericBcdBigEndianView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -2167,6 +2192,9 @@ class GenericBcdBigEndianView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -2205,6 +2233,9 @@ class GenericBcdBigEndianView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& diff --git a/testdata/golden_cpp/bits.emb.h b/testdata/golden_cpp/bits.emb.h index 4c16a6ce..9dc4b961 100644 --- a/testdata/golden_cpp/bits.emb.h +++ b/testdata/golden_cpp/bits.emb.h @@ -130,9 +130,11 @@ class GenericOneByteView final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBits().Ok() && - backing_.SizeInBits() >= static_cast( - IntrinsicSizeInBits().UncheckedRead()); + return IntrinsicSizeInBits().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBits().Ok() && + backing_.SizeInBits() >= + static_cast( + IntrinsicSizeInBits().UncheckedRead())); } static constexpr ::std::size_t SizeInBits() { return static_cast(IntrinsicSizeInBits().Read()); @@ -610,6 +612,9 @@ class GenericOneByteView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -648,6 +653,9 @@ class GenericOneByteView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -686,6 +694,9 @@ class GenericOneByteView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -853,9 +864,11 @@ class GenericTwoByteWithGapsView final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBits().Ok() && - backing_.SizeInBits() >= static_cast( - IntrinsicSizeInBits().UncheckedRead()); + return IntrinsicSizeInBits().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBits().Ok() && + backing_.SizeInBits() >= + static_cast( + IntrinsicSizeInBits().UncheckedRead())); } static constexpr ::std::size_t SizeInBits() { return static_cast(IntrinsicSizeInBits().Read()); @@ -1183,6 +1196,9 @@ class GenericTwoByteWithGapsView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -1221,6 +1237,9 @@ class GenericTwoByteWithGapsView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -1259,6 +1278,9 @@ class GenericTwoByteWithGapsView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -1409,9 +1431,11 @@ class GenericFourByteView final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBits().Ok() && - backing_.SizeInBits() >= static_cast( - IntrinsicSizeInBits().UncheckedRead()); + return IntrinsicSizeInBits().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBits().Ok() && + backing_.SizeInBits() >= + static_cast( + IntrinsicSizeInBits().UncheckedRead())); } static constexpr ::std::size_t SizeInBits() { return static_cast(IntrinsicSizeInBits().Read()); @@ -1863,6 +1887,14 @@ class GenericFourByteView final { return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); } + ::emboss::support::Maybe IsUndefined() const { + const auto emboss_reserved_local_value = MaybeRead(); + return emboss_reserved_local_value.Known() + ? ::emboss::support::Maybe(false) + : (emboss_reserved_local_value.IsUndefined() + ? ::emboss::support::Maybe(true) + : ::emboss::support::Maybe()); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -1971,6 +2003,9 @@ class GenericFourByteView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -2009,6 +2044,9 @@ class GenericFourByteView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -2047,6 +2085,9 @@ class GenericFourByteView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -2185,9 +2226,11 @@ class GenericArrayInBitsView final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBits().Ok() && - backing_.SizeInBits() >= static_cast( - IntrinsicSizeInBits().UncheckedRead()); + return IntrinsicSizeInBits().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBits().Ok() && + backing_.SizeInBits() >= + static_cast( + IntrinsicSizeInBits().UncheckedRead())); } static constexpr ::std::size_t SizeInBits() { return static_cast(IntrinsicSizeInBits().Read()); @@ -2447,6 +2490,9 @@ class GenericArrayInBitsView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -2485,6 +2531,9 @@ class GenericArrayInBitsView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -2523,6 +2572,9 @@ class GenericArrayInBitsView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -2662,10 +2714,11 @@ class GenericArrayInBitsInStructView final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBytes().Ok() && - backing_.SizeInBytes() >= - static_cast( - IntrinsicSizeInBytes().UncheckedRead()); + return IntrinsicSizeInBytes().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBytes().Ok() && + backing_.SizeInBytes() >= + static_cast( + IntrinsicSizeInBytes().UncheckedRead())); } static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); @@ -2851,6 +2904,9 @@ class GenericArrayInBitsInStructView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -2889,6 +2945,9 @@ class GenericArrayInBitsInStructView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -2927,6 +2986,9 @@ class GenericArrayInBitsInStructView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -3075,10 +3137,11 @@ class GenericStructOfBitsView final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBytes().Ok() && - backing_.SizeInBytes() >= - static_cast( - IntrinsicSizeInBytes().UncheckedRead()); + return IntrinsicSizeInBytes().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBytes().Ok() && + backing_.SizeInBytes() >= + static_cast( + IntrinsicSizeInBytes().UncheckedRead())); } ::std::size_t SizeInBytes() const { return static_cast(IntrinsicSizeInBytes().Read()); @@ -3503,6 +3566,14 @@ class GenericStructOfBitsView final { return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); } + ::emboss::support::Maybe IsUndefined() const { + const auto emboss_reserved_local_value = MaybeRead(); + return emboss_reserved_local_value.Known() + ? ::emboss::support::Maybe(false) + : (emboss_reserved_local_value.IsUndefined() + ? ::emboss::support::Maybe(true) + : ::emboss::support::Maybe()); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -3583,6 +3654,9 @@ class GenericStructOfBitsView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -3621,6 +3695,9 @@ class GenericStructOfBitsView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -3758,10 +3835,11 @@ class GenericBitArrayView final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBytes().Ok() && - backing_.SizeInBytes() >= - static_cast( - IntrinsicSizeInBytes().UncheckedRead()); + return IntrinsicSizeInBytes().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBytes().Ok() && + backing_.SizeInBytes() >= + static_cast( + IntrinsicSizeInBytes().UncheckedRead())); } static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); @@ -3950,6 +4028,9 @@ class GenericBitArrayView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -3988,6 +4069,9 @@ class GenericBitArrayView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -4026,6 +4110,9 @@ class GenericBitArrayView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& diff --git a/testdata/golden_cpp/complex_offset.emb.h b/testdata/golden_cpp/complex_offset.emb.h index 5bd586f8..ed3e74ff 100644 --- a/testdata/golden_cpp/complex_offset.emb.h +++ b/testdata/golden_cpp/complex_offset.emb.h @@ -95,10 +95,11 @@ class GenericLengthView final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBytes().Ok() && - backing_.SizeInBytes() >= - static_cast( - IntrinsicSizeInBytes().UncheckedRead()); + return IntrinsicSizeInBytes().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBytes().Ok() && + backing_.SizeInBytes() >= + static_cast( + IntrinsicSizeInBytes().UncheckedRead())); } static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); @@ -284,6 +285,9 @@ class GenericLengthView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -322,6 +326,9 @@ class GenericLengthView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -360,6 +367,9 @@ class GenericLengthView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -497,10 +507,11 @@ class GenericDataView final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBytes().Ok() && - backing_.SizeInBytes() >= - static_cast( - IntrinsicSizeInBytes().UncheckedRead()); + return IntrinsicSizeInBytes().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBytes().Ok() && + backing_.SizeInBytes() >= + static_cast( + IntrinsicSizeInBytes().UncheckedRead())); } ::std::size_t SizeInBytes() const { return static_cast(IntrinsicSizeInBytes().Read()); @@ -776,6 +787,14 @@ class GenericDataView final { return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); } + ::emboss::support::Maybe IsUndefined() const { + const auto emboss_reserved_local_value = MaybeRead(); + return emboss_reserved_local_value.Known() + ? ::emboss::support::Maybe(false) + : (emboss_reserved_local_value.IsUndefined() + ? ::emboss::support::Maybe(true) + : ::emboss::support::Maybe()); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -852,6 +871,9 @@ class GenericDataView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -890,6 +912,9 @@ class GenericDataView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -1073,10 +1098,11 @@ class GenericPackedFieldsView final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBytes().Ok() && - backing_.SizeInBytes() >= - static_cast( - IntrinsicSizeInBytes().UncheckedRead()); + return IntrinsicSizeInBytes().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBytes().Ok() && + backing_.SizeInBytes() >= + static_cast( + IntrinsicSizeInBytes().UncheckedRead())); } ::std::size_t SizeInBytes() const { return static_cast(IntrinsicSizeInBytes().Read()); @@ -2076,6 +2102,14 @@ class GenericPackedFieldsView final { return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); } + ::emboss::support::Maybe IsUndefined() const { + const auto emboss_reserved_local_value = MaybeRead(); + return emboss_reserved_local_value.Known() + ? ::emboss::support::Maybe(false) + : (emboss_reserved_local_value.IsUndefined() + ? ::emboss::support::Maybe(true) + : ::emboss::support::Maybe()); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -2157,6 +2191,14 @@ class GenericPackedFieldsView final { return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); } + ::emboss::support::Maybe IsUndefined() const { + const auto emboss_reserved_local_value = MaybeRead(); + return emboss_reserved_local_value.Known() + ? ::emboss::support::Maybe(false) + : (emboss_reserved_local_value.IsUndefined() + ? ::emboss::support::Maybe(true) + : ::emboss::support::Maybe()); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -2249,6 +2291,14 @@ class GenericPackedFieldsView final { return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); } + ::emboss::support::Maybe IsUndefined() const { + const auto emboss_reserved_local_value = MaybeRead(); + return emboss_reserved_local_value.Known() + ? ::emboss::support::Maybe(false) + : (emboss_reserved_local_value.IsUndefined() + ? ::emboss::support::Maybe(true) + : ::emboss::support::Maybe()); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -2341,6 +2391,14 @@ class GenericPackedFieldsView final { return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); } + ::emboss::support::Maybe IsUndefined() const { + const auto emboss_reserved_local_value = MaybeRead(); + return emboss_reserved_local_value.Known() + ? ::emboss::support::Maybe(false) + : (emboss_reserved_local_value.IsUndefined() + ? ::emboss::support::Maybe(true) + : ::emboss::support::Maybe()); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -2433,6 +2491,14 @@ class GenericPackedFieldsView final { return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); } + ::emboss::support::Maybe IsUndefined() const { + const auto emboss_reserved_local_value = MaybeRead(); + return emboss_reserved_local_value.Known() + ? ::emboss::support::Maybe(false) + : (emboss_reserved_local_value.IsUndefined() + ? ::emboss::support::Maybe(true) + : ::emboss::support::Maybe()); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -2527,6 +2593,14 @@ class GenericPackedFieldsView final { return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); } + ::emboss::support::Maybe IsUndefined() const { + const auto emboss_reserved_local_value = MaybeRead(); + return emboss_reserved_local_value.Known() + ? ::emboss::support::Maybe(false) + : (emboss_reserved_local_value.IsUndefined() + ? ::emboss::support::Maybe(true) + : ::emboss::support::Maybe()); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -2840,6 +2914,9 @@ class GenericPackedFieldsView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -2878,6 +2955,9 @@ class GenericPackedFieldsView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& diff --git a/testdata/golden_cpp/complex_structure.emb.h b/testdata/golden_cpp/complex_structure.emb.h index a7706f7d..0be352c0 100644 --- a/testdata/golden_cpp/complex_structure.emb.h +++ b/testdata/golden_cpp/complex_structure.emb.h @@ -109,9 +109,11 @@ class GenericRegisterLayoutView final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBits().Ok() && - backing_.SizeInBits() >= static_cast( - IntrinsicSizeInBits().UncheckedRead()); + return IntrinsicSizeInBits().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBits().Ok() && + backing_.SizeInBits() >= + static_cast( + IntrinsicSizeInBits().UncheckedRead())); } static constexpr ::std::size_t SizeInBits() { return static_cast(IntrinsicSizeInBits().Read()); @@ -439,6 +441,9 @@ class GenericRegisterLayoutView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -477,6 +482,9 @@ class GenericRegisterLayoutView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -515,6 +523,9 @@ class GenericRegisterLayoutView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -653,10 +664,11 @@ class GenericArrayElementView final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBytes().Ok() && - backing_.SizeInBytes() >= - static_cast( - IntrinsicSizeInBytes().UncheckedRead()); + return IntrinsicSizeInBytes().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBytes().Ok() && + backing_.SizeInBytes() >= + static_cast( + IntrinsicSizeInBytes().UncheckedRead())); } static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); @@ -840,6 +852,9 @@ class GenericArrayElementView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -878,6 +893,9 @@ class GenericArrayElementView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -916,6 +934,9 @@ class GenericArrayElementView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -1071,9 +1092,11 @@ class GenericEmbossReservedAnonymousField1View final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBits().Ok() && - backing_.SizeInBits() >= static_cast( - IntrinsicSizeInBits().UncheckedRead()); + return IntrinsicSizeInBits().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBits().Ok() && + backing_.SizeInBits() >= + static_cast( + IntrinsicSizeInBits().UncheckedRead())); } static constexpr ::std::size_t SizeInBits() { return static_cast(IntrinsicSizeInBits().Read()); @@ -1474,6 +1497,9 @@ class GenericEmbossReservedAnonymousField1View final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -1512,6 +1538,9 @@ class GenericEmbossReservedAnonymousField1View final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -1550,6 +1579,9 @@ class GenericEmbossReservedAnonymousField1View final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -1739,10 +1771,11 @@ class GenericComplexView final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBytes().Ok() && - backing_.SizeInBytes() >= - static_cast( - IntrinsicSizeInBytes().UncheckedRead()); + return IntrinsicSizeInBytes().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBytes().Ok() && + backing_.SizeInBytes() >= + static_cast( + IntrinsicSizeInBytes().UncheckedRead())); } ::std::size_t SizeInBytes() const { return static_cast(IntrinsicSizeInBytes().Read()); @@ -3003,6 +3036,14 @@ class GenericComplexView final { return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); } + ::emboss::support::Maybe IsUndefined() const { + const auto emboss_reserved_local_value = MaybeRead(); + return emboss_reserved_local_value.Known() + ? ::emboss::support::Maybe(false) + : (emboss_reserved_local_value.IsUndefined() + ? ::emboss::support::Maybe(true) + : ::emboss::support::Maybe()); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -3258,6 +3299,9 @@ class GenericComplexView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -3296,6 +3340,9 @@ class GenericComplexView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& diff --git a/testdata/golden_cpp/condition.emb.h b/testdata/golden_cpp/condition.emb.h index 725fe824..55544e24 100644 --- a/testdata/golden_cpp/condition.emb.h +++ b/testdata/golden_cpp/condition.emb.h @@ -281,10 +281,11 @@ class GenericBasicConditionalView final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBytes().Ok() && - backing_.SizeInBytes() >= - static_cast( - IntrinsicSizeInBytes().UncheckedRead()); + return IntrinsicSizeInBytes().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBytes().Ok() && + backing_.SizeInBytes() >= + static_cast( + IntrinsicSizeInBytes().UncheckedRead())); } ::std::size_t SizeInBytes() const { return static_cast(IntrinsicSizeInBytes().Read()); @@ -561,6 +562,14 @@ class GenericBasicConditionalView final { return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); } + ::emboss::support::Maybe IsUndefined() const { + const auto emboss_reserved_local_value = MaybeRead(); + return emboss_reserved_local_value.Known() + ? ::emboss::support::Maybe(false) + : (emboss_reserved_local_value.IsUndefined() + ? ::emboss::support::Maybe(true) + : ::emboss::support::Maybe()); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -638,6 +647,9 @@ class GenericBasicConditionalView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -676,6 +688,9 @@ class GenericBasicConditionalView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -818,10 +833,11 @@ class GenericNegativeConditionalView final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBytes().Ok() && - backing_.SizeInBytes() >= - static_cast( - IntrinsicSizeInBytes().UncheckedRead()); + return IntrinsicSizeInBytes().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBytes().Ok() && + backing_.SizeInBytes() >= + static_cast( + IntrinsicSizeInBytes().UncheckedRead())); } ::std::size_t SizeInBytes() const { return static_cast(IntrinsicSizeInBytes().Read()); @@ -1098,6 +1114,14 @@ class GenericNegativeConditionalView final { return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); } + ::emboss::support::Maybe IsUndefined() const { + const auto emboss_reserved_local_value = MaybeRead(); + return emboss_reserved_local_value.Known() + ? ::emboss::support::Maybe(false) + : (emboss_reserved_local_value.IsUndefined() + ? ::emboss::support::Maybe(true) + : ::emboss::support::Maybe()); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -1175,6 +1199,9 @@ class GenericNegativeConditionalView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -1213,6 +1240,9 @@ class GenericNegativeConditionalView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -1364,10 +1394,11 @@ class GenericConditionalAndUnconditionalOverlappingFinalFieldView final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBytes().Ok() && - backing_.SizeInBytes() >= - static_cast( - IntrinsicSizeInBytes().UncheckedRead()); + return IntrinsicSizeInBytes().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBytes().Ok() && + backing_.SizeInBytes() >= + static_cast( + IntrinsicSizeInBytes().UncheckedRead())); } static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); @@ -1710,6 +1741,9 @@ class GenericConditionalAndUnconditionalOverlappingFinalFieldView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -1748,6 +1782,9 @@ class GenericConditionalAndUnconditionalOverlappingFinalFieldView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -1786,6 +1823,9 @@ class GenericConditionalAndUnconditionalOverlappingFinalFieldView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -1938,10 +1978,11 @@ class GenericConditionalBasicConditionalFieldFirstView final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBytes().Ok() && - backing_.SizeInBytes() >= - static_cast( - IntrinsicSizeInBytes().UncheckedRead()); + return IntrinsicSizeInBytes().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBytes().Ok() && + backing_.SizeInBytes() >= + static_cast( + IntrinsicSizeInBytes().UncheckedRead())); } static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); @@ -2206,6 +2247,9 @@ class GenericConditionalBasicConditionalFieldFirstView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -2244,6 +2288,9 @@ class GenericConditionalBasicConditionalFieldFirstView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -2282,6 +2329,9 @@ class GenericConditionalBasicConditionalFieldFirstView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -2435,10 +2485,11 @@ class GenericConditionalAndDynamicLocationView final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBytes().Ok() && - backing_.SizeInBytes() >= - static_cast( - IntrinsicSizeInBytes().UncheckedRead()); + return IntrinsicSizeInBytes().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBytes().Ok() && + backing_.SizeInBytes() >= + static_cast( + IntrinsicSizeInBytes().UncheckedRead())); } ::std::size_t SizeInBytes() const { return static_cast(IntrinsicSizeInBytes().Read()); @@ -2792,6 +2843,14 @@ class GenericConditionalAndDynamicLocationView final { return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); } + ::emboss::support::Maybe IsUndefined() const { + const auto emboss_reserved_local_value = MaybeRead(); + return emboss_reserved_local_value.Known() + ? ::emboss::support::Maybe(false) + : (emboss_reserved_local_value.IsUndefined() + ? ::emboss::support::Maybe(true) + : ::emboss::support::Maybe()); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -2882,6 +2941,9 @@ class GenericConditionalAndDynamicLocationView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -2920,6 +2982,9 @@ class GenericConditionalAndDynamicLocationView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -3064,10 +3129,11 @@ class GenericConditionUsesMinIntView final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBytes().Ok() && - backing_.SizeInBytes() >= - static_cast( - IntrinsicSizeInBytes().UncheckedRead()); + return IntrinsicSizeInBytes().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBytes().Ok() && + backing_.SizeInBytes() >= + static_cast( + IntrinsicSizeInBytes().UncheckedRead())); } ::std::size_t SizeInBytes() const { return static_cast(IntrinsicSizeInBytes().Read()); @@ -3344,6 +3410,14 @@ class GenericConditionUsesMinIntView final { return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); } + ::emboss::support::Maybe IsUndefined() const { + const auto emboss_reserved_local_value = MaybeRead(); + return emboss_reserved_local_value.Known() + ? ::emboss::support::Maybe(false) + : (emboss_reserved_local_value.IsUndefined() + ? ::emboss::support::Maybe(true) + : ::emboss::support::Maybe()); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -3426,6 +3500,9 @@ class GenericConditionUsesMinIntView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -3464,6 +3541,9 @@ class GenericConditionUsesMinIntView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -3608,10 +3688,11 @@ class GenericNestedConditionalView final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBytes().Ok() && - backing_.SizeInBytes() >= - static_cast( - IntrinsicSizeInBytes().UncheckedRead()); + return IntrinsicSizeInBytes().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBytes().Ok() && + backing_.SizeInBytes() >= + static_cast( + IntrinsicSizeInBytes().UncheckedRead())); } ::std::size_t SizeInBytes() const { return static_cast(IntrinsicSizeInBytes().Read()); @@ -3964,6 +4045,14 @@ class GenericNestedConditionalView final { return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); } + ::emboss::support::Maybe IsUndefined() const { + const auto emboss_reserved_local_value = MaybeRead(); + return emboss_reserved_local_value.Known() + ? ::emboss::support::Maybe(false) + : (emboss_reserved_local_value.IsUndefined() + ? ::emboss::support::Maybe(true) + : ::emboss::support::Maybe()); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -4062,6 +4151,9 @@ class GenericNestedConditionalView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -4100,6 +4192,9 @@ class GenericNestedConditionalView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -4263,10 +4358,11 @@ class GenericCorrectNestedConditionalView final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBytes().Ok() && - backing_.SizeInBytes() >= - static_cast( - IntrinsicSizeInBytes().UncheckedRead()); + return IntrinsicSizeInBytes().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBytes().Ok() && + backing_.SizeInBytes() >= + static_cast( + IntrinsicSizeInBytes().UncheckedRead())); } ::std::size_t SizeInBytes() const { return static_cast(IntrinsicSizeInBytes().Read()); @@ -4619,6 +4715,14 @@ class GenericCorrectNestedConditionalView final { return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); } + ::emboss::support::Maybe IsUndefined() const { + const auto emboss_reserved_local_value = MaybeRead(); + return emboss_reserved_local_value.Known() + ? ::emboss::support::Maybe(false) + : (emboss_reserved_local_value.IsUndefined() + ? ::emboss::support::Maybe(true) + : ::emboss::support::Maybe()); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -4720,6 +4824,9 @@ class GenericCorrectNestedConditionalView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -4758,6 +4865,9 @@ class GenericCorrectNestedConditionalView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -4900,10 +5010,11 @@ class GenericAlwaysFalseConditionView final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBytes().Ok() && - backing_.SizeInBytes() >= - static_cast( - IntrinsicSizeInBytes().UncheckedRead()); + return IntrinsicSizeInBytes().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBytes().Ok() && + backing_.SizeInBytes() >= + static_cast( + IntrinsicSizeInBytes().UncheckedRead())); } static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); @@ -5165,6 +5276,9 @@ class GenericAlwaysFalseConditionView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -5203,6 +5317,9 @@ class GenericAlwaysFalseConditionView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -5241,6 +5358,9 @@ class GenericAlwaysFalseConditionView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -5381,10 +5501,11 @@ class GenericOnlyAlwaysFalseConditionView final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBytes().Ok() && - backing_.SizeInBytes() >= - static_cast( - IntrinsicSizeInBytes().UncheckedRead()); + return IntrinsicSizeInBytes().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBytes().Ok() && + backing_.SizeInBytes() >= + static_cast( + IntrinsicSizeInBytes().UncheckedRead())); } static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); @@ -5570,6 +5691,9 @@ class GenericOnlyAlwaysFalseConditionView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -5608,6 +5732,9 @@ class GenericOnlyAlwaysFalseConditionView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -5646,6 +5773,9 @@ class GenericOnlyAlwaysFalseConditionView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -5780,10 +5910,11 @@ class GenericEmptyStructView final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBytes().Ok() && - backing_.SizeInBytes() >= - static_cast( - IntrinsicSizeInBytes().UncheckedRead()); + return IntrinsicSizeInBytes().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBytes().Ok() && + backing_.SizeInBytes() >= + static_cast( + IntrinsicSizeInBytes().UncheckedRead())); } static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); @@ -5895,6 +6026,9 @@ class GenericEmptyStructView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -5933,6 +6067,9 @@ class GenericEmptyStructView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -5971,6 +6108,9 @@ class GenericEmptyStructView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -6120,10 +6260,11 @@ class GenericAlwaysFalseConditionDynamicSizeView final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBytes().Ok() && - backing_.SizeInBytes() >= - static_cast( - IntrinsicSizeInBytes().UncheckedRead()); + return IntrinsicSizeInBytes().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBytes().Ok() && + backing_.SizeInBytes() >= + static_cast( + IntrinsicSizeInBytes().UncheckedRead())); } ::std::size_t SizeInBytes() const { return static_cast(IntrinsicSizeInBytes().Read()); @@ -6478,6 +6619,14 @@ class GenericAlwaysFalseConditionDynamicSizeView final { return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); } + ::emboss::support::Maybe IsUndefined() const { + const auto emboss_reserved_local_value = MaybeRead(); + return emboss_reserved_local_value.Known() + ? ::emboss::support::Maybe(false) + : (emboss_reserved_local_value.IsUndefined() + ? ::emboss::support::Maybe(true) + : ::emboss::support::Maybe()); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -6556,6 +6705,9 @@ class GenericAlwaysFalseConditionDynamicSizeView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -6594,6 +6746,9 @@ class GenericAlwaysFalseConditionDynamicSizeView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -6746,10 +6901,11 @@ class GenericConditionDoesNotContributeToSizeView final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBytes().Ok() && - backing_.SizeInBytes() >= - static_cast( - IntrinsicSizeInBytes().UncheckedRead()); + return IntrinsicSizeInBytes().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBytes().Ok() && + backing_.SizeInBytes() >= + static_cast( + IntrinsicSizeInBytes().UncheckedRead())); } static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); @@ -7088,6 +7244,9 @@ class GenericConditionDoesNotContributeToSizeView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -7126,6 +7285,9 @@ class GenericConditionDoesNotContributeToSizeView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -7164,6 +7326,9 @@ class GenericConditionDoesNotContributeToSizeView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -7399,10 +7564,11 @@ class GenericEnumConditionView final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBytes().Ok() && - backing_.SizeInBytes() >= - static_cast( - IntrinsicSizeInBytes().UncheckedRead()); + return IntrinsicSizeInBytes().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBytes().Ok() && + backing_.SizeInBytes() >= + static_cast( + IntrinsicSizeInBytes().UncheckedRead())); } ::std::size_t SizeInBytes() const { return static_cast(IntrinsicSizeInBytes().Read()); @@ -7756,6 +7922,14 @@ class GenericEnumConditionView final { return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); } + ::emboss::support::Maybe IsUndefined() const { + const auto emboss_reserved_local_value = MaybeRead(); + return emboss_reserved_local_value.Known() + ? ::emboss::support::Maybe(false) + : (emboss_reserved_local_value.IsUndefined() + ? ::emboss::support::Maybe(true) + : ::emboss::support::Maybe()); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -7849,6 +8023,9 @@ class GenericEnumConditionView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -7887,6 +8064,9 @@ class GenericEnumConditionView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -8029,10 +8209,11 @@ class GenericNegativeEnumConditionView final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBytes().Ok() && - backing_.SizeInBytes() >= - static_cast( - IntrinsicSizeInBytes().UncheckedRead()); + return IntrinsicSizeInBytes().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBytes().Ok() && + backing_.SizeInBytes() >= + static_cast( + IntrinsicSizeInBytes().UncheckedRead())); } ::std::size_t SizeInBytes() const { return static_cast(IntrinsicSizeInBytes().Read()); @@ -8310,6 +8491,14 @@ class GenericNegativeEnumConditionView final { return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); } + ::emboss::support::Maybe IsUndefined() const { + const auto emboss_reserved_local_value = MaybeRead(); + return emboss_reserved_local_value.Known() + ? ::emboss::support::Maybe(false) + : (emboss_reserved_local_value.IsUndefined() + ? ::emboss::support::Maybe(true) + : ::emboss::support::Maybe()); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -8388,6 +8577,9 @@ class GenericNegativeEnumConditionView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -8426,6 +8618,9 @@ class GenericNegativeEnumConditionView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -8567,10 +8762,11 @@ class GenericLessThanConditionView final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBytes().Ok() && - backing_.SizeInBytes() >= - static_cast( - IntrinsicSizeInBytes().UncheckedRead()); + return IntrinsicSizeInBytes().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBytes().Ok() && + backing_.SizeInBytes() >= + static_cast( + IntrinsicSizeInBytes().UncheckedRead())); } ::std::size_t SizeInBytes() const { return static_cast(IntrinsicSizeInBytes().Read()); @@ -8847,6 +9043,14 @@ class GenericLessThanConditionView final { return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); } + ::emboss::support::Maybe IsUndefined() const { + const auto emboss_reserved_local_value = MaybeRead(); + return emboss_reserved_local_value.Known() + ? ::emboss::support::Maybe(false) + : (emboss_reserved_local_value.IsUndefined() + ? ::emboss::support::Maybe(true) + : ::emboss::support::Maybe()); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -8924,6 +9128,9 @@ class GenericLessThanConditionView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -8962,6 +9169,9 @@ class GenericLessThanConditionView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -9105,10 +9315,11 @@ class GenericLessThanOrEqualConditionView final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBytes().Ok() && - backing_.SizeInBytes() >= - static_cast( - IntrinsicSizeInBytes().UncheckedRead()); + return IntrinsicSizeInBytes().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBytes().Ok() && + backing_.SizeInBytes() >= + static_cast( + IntrinsicSizeInBytes().UncheckedRead())); } ::std::size_t SizeInBytes() const { return static_cast(IntrinsicSizeInBytes().Read()); @@ -9385,6 +9596,14 @@ class GenericLessThanOrEqualConditionView final { return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); } + ::emboss::support::Maybe IsUndefined() const { + const auto emboss_reserved_local_value = MaybeRead(); + return emboss_reserved_local_value.Known() + ? ::emboss::support::Maybe(false) + : (emboss_reserved_local_value.IsUndefined() + ? ::emboss::support::Maybe(true) + : ::emboss::support::Maybe()); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -9462,6 +9681,9 @@ class GenericLessThanOrEqualConditionView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -9500,6 +9722,9 @@ class GenericLessThanOrEqualConditionView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -9646,10 +9871,11 @@ class GenericGreaterThanOrEqualConditionView final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBytes().Ok() && - backing_.SizeInBytes() >= - static_cast( - IntrinsicSizeInBytes().UncheckedRead()); + return IntrinsicSizeInBytes().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBytes().Ok() && + backing_.SizeInBytes() >= + static_cast( + IntrinsicSizeInBytes().UncheckedRead())); } ::std::size_t SizeInBytes() const { return static_cast(IntrinsicSizeInBytes().Read()); @@ -9927,6 +10153,14 @@ class GenericGreaterThanOrEqualConditionView final { return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); } + ::emboss::support::Maybe IsUndefined() const { + const auto emboss_reserved_local_value = MaybeRead(); + return emboss_reserved_local_value.Known() + ? ::emboss::support::Maybe(false) + : (emboss_reserved_local_value.IsUndefined() + ? ::emboss::support::Maybe(true) + : ::emboss::support::Maybe()); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -10004,6 +10238,9 @@ class GenericGreaterThanOrEqualConditionView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -10042,6 +10279,9 @@ class GenericGreaterThanOrEqualConditionView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -10185,10 +10425,11 @@ class GenericGreaterThanConditionView final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBytes().Ok() && - backing_.SizeInBytes() >= - static_cast( - IntrinsicSizeInBytes().UncheckedRead()); + return IntrinsicSizeInBytes().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBytes().Ok() && + backing_.SizeInBytes() >= + static_cast( + IntrinsicSizeInBytes().UncheckedRead())); } ::std::size_t SizeInBytes() const { return static_cast(IntrinsicSizeInBytes().Read()); @@ -10465,6 +10706,14 @@ class GenericGreaterThanConditionView final { return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); } + ::emboss::support::Maybe IsUndefined() const { + const auto emboss_reserved_local_value = MaybeRead(); + return emboss_reserved_local_value.Known() + ? ::emboss::support::Maybe(false) + : (emboss_reserved_local_value.IsUndefined() + ? ::emboss::support::Maybe(true) + : ::emboss::support::Maybe()); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -10542,6 +10791,9 @@ class GenericGreaterThanConditionView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -10580,6 +10832,9 @@ class GenericGreaterThanConditionView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -10724,10 +10979,11 @@ class GenericRangeConditionView final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBytes().Ok() && - backing_.SizeInBytes() >= - static_cast( - IntrinsicSizeInBytes().UncheckedRead()); + return IntrinsicSizeInBytes().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBytes().Ok() && + backing_.SizeInBytes() >= + static_cast( + IntrinsicSizeInBytes().UncheckedRead())); } ::std::size_t SizeInBytes() const { return static_cast(IntrinsicSizeInBytes().Read()); @@ -11080,6 +11336,14 @@ class GenericRangeConditionView final { return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); } + ::emboss::support::Maybe IsUndefined() const { + const auto emboss_reserved_local_value = MaybeRead(); + return emboss_reserved_local_value.Known() + ? ::emboss::support::Maybe(false) + : (emboss_reserved_local_value.IsUndefined() + ? ::emboss::support::Maybe(true) + : ::emboss::support::Maybe()); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -11182,6 +11446,9 @@ class GenericRangeConditionView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -11220,6 +11487,9 @@ class GenericRangeConditionView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -11365,10 +11635,11 @@ class GenericReverseRangeConditionView final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBytes().Ok() && - backing_.SizeInBytes() >= - static_cast( - IntrinsicSizeInBytes().UncheckedRead()); + return IntrinsicSizeInBytes().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBytes().Ok() && + backing_.SizeInBytes() >= + static_cast( + IntrinsicSizeInBytes().UncheckedRead())); } ::std::size_t SizeInBytes() const { return static_cast(IntrinsicSizeInBytes().Read()); @@ -11721,6 +11992,14 @@ class GenericReverseRangeConditionView final { return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); } + ::emboss::support::Maybe IsUndefined() const { + const auto emboss_reserved_local_value = MaybeRead(); + return emboss_reserved_local_value.Known() + ? ::emboss::support::Maybe(false) + : (emboss_reserved_local_value.IsUndefined() + ? ::emboss::support::Maybe(true) + : ::emboss::support::Maybe()); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -11823,6 +12102,9 @@ class GenericReverseRangeConditionView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -11861,6 +12143,9 @@ class GenericReverseRangeConditionView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -12005,10 +12290,11 @@ class GenericAndConditionView final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBytes().Ok() && - backing_.SizeInBytes() >= - static_cast( - IntrinsicSizeInBytes().UncheckedRead()); + return IntrinsicSizeInBytes().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBytes().Ok() && + backing_.SizeInBytes() >= + static_cast( + IntrinsicSizeInBytes().UncheckedRead())); } ::std::size_t SizeInBytes() const { return static_cast(IntrinsicSizeInBytes().Read()); @@ -12361,6 +12647,14 @@ class GenericAndConditionView final { return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); } + ::emboss::support::Maybe IsUndefined() const { + const auto emboss_reserved_local_value = MaybeRead(); + return emboss_reserved_local_value.Known() + ? ::emboss::support::Maybe(false) + : (emboss_reserved_local_value.IsUndefined() + ? ::emboss::support::Maybe(true) + : ::emboss::support::Maybe()); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -12456,6 +12750,9 @@ class GenericAndConditionView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -12494,6 +12791,9 @@ class GenericAndConditionView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -12637,10 +12937,11 @@ class GenericOrConditionView final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBytes().Ok() && - backing_.SizeInBytes() >= - static_cast( - IntrinsicSizeInBytes().UncheckedRead()); + return IntrinsicSizeInBytes().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBytes().Ok() && + backing_.SizeInBytes() >= + static_cast( + IntrinsicSizeInBytes().UncheckedRead())); } ::std::size_t SizeInBytes() const { return static_cast(IntrinsicSizeInBytes().Read()); @@ -12993,6 +13294,14 @@ class GenericOrConditionView final { return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); } + ::emboss::support::Maybe IsUndefined() const { + const auto emboss_reserved_local_value = MaybeRead(); + return emboss_reserved_local_value.Known() + ? ::emboss::support::Maybe(false) + : (emboss_reserved_local_value.IsUndefined() + ? ::emboss::support::Maybe(true) + : ::emboss::support::Maybe()); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -13088,6 +13397,9 @@ class GenericOrConditionView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -13126,6 +13438,9 @@ class GenericOrConditionView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -13365,10 +13680,11 @@ class GenericChoiceConditionView final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBytes().Ok() && - backing_.SizeInBytes() >= - static_cast( - IntrinsicSizeInBytes().UncheckedRead()); + return IntrinsicSizeInBytes().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBytes().Ok() && + backing_.SizeInBytes() >= + static_cast( + IntrinsicSizeInBytes().UncheckedRead())); } ::std::size_t SizeInBytes() const { return static_cast(IntrinsicSizeInBytes().Read()); @@ -13798,6 +14114,14 @@ class GenericChoiceConditionView final { return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); } + ::emboss::support::Maybe IsUndefined() const { + const auto emboss_reserved_local_value = MaybeRead(); + return emboss_reserved_local_value.Known() + ? ::emboss::support::Maybe(false) + : (emboss_reserved_local_value.IsUndefined() + ? ::emboss::support::Maybe(true) + : ::emboss::support::Maybe()); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -13906,6 +14230,9 @@ class GenericChoiceConditionView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -13944,6 +14271,9 @@ class GenericChoiceConditionView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -14093,9 +14423,11 @@ class GenericEmbossReservedAnonymousField3View final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBits().Ok() && - backing_.SizeInBits() >= static_cast( - IntrinsicSizeInBits().UncheckedRead()); + return IntrinsicSizeInBits().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBits().Ok() && + backing_.SizeInBits() >= + static_cast( + IntrinsicSizeInBits().UncheckedRead())); } static constexpr ::std::size_t SizeInBits() { return static_cast(IntrinsicSizeInBits().Read()); @@ -14350,6 +14682,9 @@ class GenericEmbossReservedAnonymousField3View final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -14388,6 +14723,9 @@ class GenericEmbossReservedAnonymousField3View final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -14426,6 +14764,9 @@ class GenericEmbossReservedAnonymousField3View final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -14574,10 +14915,11 @@ class GenericContainsBitsView final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBytes().Ok() && - backing_.SizeInBytes() >= - static_cast( - IntrinsicSizeInBytes().UncheckedRead()); + return IntrinsicSizeInBytes().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBytes().Ok() && + backing_.SizeInBytes() >= + static_cast( + IntrinsicSizeInBytes().UncheckedRead())); } static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); @@ -14829,6 +15171,9 @@ class GenericContainsBitsView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -14867,6 +15212,9 @@ class GenericContainsBitsView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -14905,6 +15253,9 @@ class GenericContainsBitsView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -15047,10 +15398,11 @@ class GenericContainsContainsBitsView final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBytes().Ok() && - backing_.SizeInBytes() >= - static_cast( - IntrinsicSizeInBytes().UncheckedRead()); + return IntrinsicSizeInBytes().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBytes().Ok() && + backing_.SizeInBytes() >= + static_cast( + IntrinsicSizeInBytes().UncheckedRead())); } ::std::size_t SizeInBytes() const { return static_cast(IntrinsicSizeInBytes().Read()); @@ -15322,6 +15674,14 @@ class GenericContainsContainsBitsView final { return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); } + ::emboss::support::Maybe IsUndefined() const { + const auto emboss_reserved_local_value = MaybeRead(); + return emboss_reserved_local_value.Known() + ? ::emboss::support::Maybe(false) + : (emboss_reserved_local_value.IsUndefined() + ? ::emboss::support::Maybe(true) + : ::emboss::support::Maybe()); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -15399,6 +15759,9 @@ class GenericContainsContainsBitsView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -15437,6 +15800,9 @@ class GenericContainsContainsBitsView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -15582,10 +15948,11 @@ class GenericType0View final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBytes().Ok() && - backing_.SizeInBytes() >= - static_cast( - IntrinsicSizeInBytes().UncheckedRead()); + return IntrinsicSizeInBytes().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBytes().Ok() && + backing_.SizeInBytes() >= + static_cast( + IntrinsicSizeInBytes().UncheckedRead())); } static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); @@ -15923,6 +16290,9 @@ class GenericType0View final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -15961,6 +16331,9 @@ class GenericType0View final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -15999,6 +16372,9 @@ class GenericType0View final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -16139,10 +16515,11 @@ class GenericType1View final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBytes().Ok() && - backing_.SizeInBytes() >= - static_cast( - IntrinsicSizeInBytes().UncheckedRead()); + return IntrinsicSizeInBytes().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBytes().Ok() && + backing_.SizeInBytes() >= + static_cast( + IntrinsicSizeInBytes().UncheckedRead())); } static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); @@ -16480,6 +16857,9 @@ class GenericType1View final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -16518,6 +16898,9 @@ class GenericType1View final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -16556,6 +16939,9 @@ class GenericType1View final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -16716,10 +17102,11 @@ class GenericConditionalInlineView final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBytes().Ok() && - backing_.SizeInBytes() >= - static_cast( - IntrinsicSizeInBytes().UncheckedRead()); + return IntrinsicSizeInBytes().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBytes().Ok() && + backing_.SizeInBytes() >= + static_cast( + IntrinsicSizeInBytes().UncheckedRead())); } ::std::size_t SizeInBytes() const { return static_cast(IntrinsicSizeInBytes().Read()); @@ -17062,6 +17449,14 @@ class GenericConditionalInlineView final { return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); } + ::emboss::support::Maybe IsUndefined() const { + const auto emboss_reserved_local_value = MaybeRead(); + return emboss_reserved_local_value.Known() + ? ::emboss::support::Maybe(false) + : (emboss_reserved_local_value.IsUndefined() + ? ::emboss::support::Maybe(true) + : ::emboss::support::Maybe()); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -17153,6 +17548,9 @@ class GenericConditionalInlineView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -17191,6 +17589,9 @@ class GenericConditionalInlineView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -17343,9 +17744,11 @@ class GenericEmbossReservedAnonymousField2View final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBits().Ok() && - backing_.SizeInBits() >= static_cast( - IntrinsicSizeInBits().UncheckedRead()); + return IntrinsicSizeInBits().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBits().Ok() && + backing_.SizeInBits() >= + static_cast( + IntrinsicSizeInBits().UncheckedRead())); } static constexpr ::std::size_t SizeInBits() { return static_cast(IntrinsicSizeInBits().Read()); @@ -17673,6 +18076,9 @@ class GenericEmbossReservedAnonymousField2View final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -17711,6 +18117,9 @@ class GenericEmbossReservedAnonymousField2View final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -17749,6 +18158,9 @@ class GenericEmbossReservedAnonymousField2View final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -17904,10 +18316,11 @@ class GenericConditionalAnonymousView final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBytes().Ok() && - backing_.SizeInBytes() >= - static_cast( - IntrinsicSizeInBytes().UncheckedRead()); + return IntrinsicSizeInBytes().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBytes().Ok() && + backing_.SizeInBytes() >= + static_cast( + IntrinsicSizeInBytes().UncheckedRead())); } ::std::size_t SizeInBytes() const { return static_cast(IntrinsicSizeInBytes().Read()); @@ -18294,6 +18707,14 @@ class GenericConditionalAnonymousView final { return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); } + ::emboss::support::Maybe IsUndefined() const { + const auto emboss_reserved_local_value = MaybeRead(); + return emboss_reserved_local_value.Known() + ? ::emboss::support::Maybe(false) + : (emboss_reserved_local_value.IsUndefined() + ? ::emboss::support::Maybe(true) + : ::emboss::support::Maybe()); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -18371,6 +18792,9 @@ class GenericConditionalAnonymousView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -18409,6 +18833,9 @@ class GenericConditionalAnonymousView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -18555,9 +18982,11 @@ class GenericEmbossReservedAnonymousField1View final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBits().Ok() && - backing_.SizeInBits() >= static_cast( - IntrinsicSizeInBits().UncheckedRead()); + return IntrinsicSizeInBits().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBits().Ok() && + backing_.SizeInBits() >= + static_cast( + IntrinsicSizeInBits().UncheckedRead())); } static constexpr ::std::size_t SizeInBits() { return static_cast(IntrinsicSizeInBits().Read()); @@ -18739,6 +19168,9 @@ class GenericEmbossReservedAnonymousField1View final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -18777,6 +19209,9 @@ class GenericEmbossReservedAnonymousField1View final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -18815,6 +19250,9 @@ class GenericEmbossReservedAnonymousField1View final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -18963,10 +19401,11 @@ class GenericConditionalOnFlagView final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBytes().Ok() && - backing_.SizeInBytes() >= - static_cast( - IntrinsicSizeInBytes().UncheckedRead()); + return IntrinsicSizeInBytes().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBytes().Ok() && + backing_.SizeInBytes() >= + static_cast( + IntrinsicSizeInBytes().UncheckedRead())); } ::std::size_t SizeInBytes() const { return static_cast(IntrinsicSizeInBytes().Read()); @@ -19262,6 +19701,14 @@ class GenericConditionalOnFlagView final { return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); } + ::emboss::support::Maybe IsUndefined() const { + const auto emboss_reserved_local_value = MaybeRead(); + return emboss_reserved_local_value.Known() + ? ::emboss::support::Maybe(false) + : (emboss_reserved_local_value.IsUndefined() + ? ::emboss::support::Maybe(true) + : ::emboss::support::Maybe()); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -19332,6 +19779,9 @@ class GenericConditionalOnFlagView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -19370,6 +19820,9 @@ class GenericConditionalOnFlagView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& diff --git a/testdata/golden_cpp/division_modulus.emb.h b/testdata/golden_cpp/division_modulus.emb.h index 267295eb..584fda54 100644 --- a/testdata/golden_cpp/division_modulus.emb.h +++ b/testdata/golden_cpp/division_modulus.emb.h @@ -118,10 +118,11 @@ class GenericArrayOfUint16BySizeInBytesView final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBytes().Ok() && - backing_.SizeInBytes() >= - static_cast( - IntrinsicSizeInBytes().UncheckedRead()); + return IntrinsicSizeInBytes().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBytes().Ok() && + backing_.SizeInBytes() >= + static_cast( + IntrinsicSizeInBytes().UncheckedRead())); } ::std::size_t SizeInBytes() const { return static_cast(IntrinsicSizeInBytes().Read()); @@ -405,6 +406,14 @@ class GenericArrayOfUint16BySizeInBytesView final { return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); } + ::emboss::support::Maybe IsUndefined() const { + const auto emboss_reserved_local_value = MaybeRead(); + return emboss_reserved_local_value.Known() + ? ::emboss::support::Maybe(false) + : (emboss_reserved_local_value.IsUndefined() + ? ::emboss::support::Maybe(true) + : ::emboss::support::Maybe()); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -494,6 +503,9 @@ class GenericArrayOfUint16BySizeInBytesView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -532,6 +544,9 @@ class GenericArrayOfUint16BySizeInBytesView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -673,10 +688,11 @@ class GenericChunkedPayloadView final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBytes().Ok() && - backing_.SizeInBytes() >= - static_cast( - IntrinsicSizeInBytes().UncheckedRead()); + return IntrinsicSizeInBytes().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBytes().Ok() && + backing_.SizeInBytes() >= + static_cast( + IntrinsicSizeInBytes().UncheckedRead())); } ::std::size_t SizeInBytes() const { return static_cast(IntrinsicSizeInBytes().Read()); @@ -959,6 +975,14 @@ class GenericChunkedPayloadView final { return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); } + ::emboss::support::Maybe IsUndefined() const { + const auto emboss_reserved_local_value = MaybeRead(); + return emboss_reserved_local_value.Known() + ? ::emboss::support::Maybe(false) + : (emboss_reserved_local_value.IsUndefined() + ? ::emboss::support::Maybe(true) + : ::emboss::support::Maybe()); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -1054,6 +1078,9 @@ class GenericChunkedPayloadView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -1092,6 +1119,9 @@ class GenericChunkedPayloadView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -1261,10 +1291,11 @@ class GenericConstantsView final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBytes().Ok() && - backing_.SizeInBytes() >= - static_cast( - IntrinsicSizeInBytes().UncheckedRead()); + return IntrinsicSizeInBytes().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBytes().Ok() && + backing_.SizeInBytes() >= + static_cast( + IntrinsicSizeInBytes().UncheckedRead())); } static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); @@ -1549,6 +1580,9 @@ class GenericConstantsView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -1586,6 +1620,9 @@ class GenericConstantsView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -1624,6 +1661,9 @@ class GenericConstantsView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -1662,6 +1702,9 @@ class GenericConstantsView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -1699,6 +1742,9 @@ class GenericConstantsView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -1737,6 +1783,9 @@ class GenericConstantsView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -1774,6 +1823,9 @@ class GenericConstantsView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -1811,6 +1863,9 @@ class GenericConstantsView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -1848,6 +1903,9 @@ class GenericConstantsView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -1885,6 +1943,9 @@ class GenericConstantsView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -1923,6 +1984,9 @@ class GenericConstantsView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -1961,6 +2025,9 @@ class GenericConstantsView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -2103,10 +2170,11 @@ class GenericPayloadSizedByDivisionView final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBytes().Ok() && - backing_.SizeInBytes() >= - static_cast( - IntrinsicSizeInBytes().UncheckedRead()); + return IntrinsicSizeInBytes().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBytes().Ok() && + backing_.SizeInBytes() >= + static_cast( + IntrinsicSizeInBytes().UncheckedRead())); } ::std::size_t SizeInBytes() const { return static_cast(IntrinsicSizeInBytes().Read()); @@ -2388,6 +2456,14 @@ class GenericPayloadSizedByDivisionView final { return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); } + ::emboss::support::Maybe IsUndefined() const { + const auto emboss_reserved_local_value = MaybeRead(); + return emboss_reserved_local_value.Known() + ? ::emboss::support::Maybe(false) + : (emboss_reserved_local_value.IsUndefined() + ? ::emboss::support::Maybe(true) + : ::emboss::support::Maybe()); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -2471,6 +2547,9 @@ class GenericPayloadSizedByDivisionView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -2509,6 +2588,9 @@ class GenericPayloadSizedByDivisionView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -2651,10 +2733,11 @@ class GenericFieldGatedByDivisionView final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBytes().Ok() && - backing_.SizeInBytes() >= - static_cast( - IntrinsicSizeInBytes().UncheckedRead()); + return IntrinsicSizeInBytes().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBytes().Ok() && + backing_.SizeInBytes() >= + static_cast( + IntrinsicSizeInBytes().UncheckedRead())); } ::std::size_t SizeInBytes() const { return static_cast(IntrinsicSizeInBytes().Read()); @@ -2931,6 +3014,14 @@ class GenericFieldGatedByDivisionView final { return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); } + ::emboss::support::Maybe IsUndefined() const { + const auto emboss_reserved_local_value = MaybeRead(); + return emboss_reserved_local_value.Known() + ? ::emboss::support::Maybe(false) + : (emboss_reserved_local_value.IsUndefined() + ? ::emboss::support::Maybe(true) + : ::emboss::support::Maybe()); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -3015,6 +3106,9 @@ class GenericFieldGatedByDivisionView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -3053,6 +3147,9 @@ class GenericFieldGatedByDivisionView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -3196,10 +3293,11 @@ class GenericCollapsingQuotientView final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBytes().Ok() && - backing_.SizeInBytes() >= - static_cast( - IntrinsicSizeInBytes().UncheckedRead()); + return IntrinsicSizeInBytes().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBytes().Ok() && + backing_.SizeInBytes() >= + static_cast( + IntrinsicSizeInBytes().UncheckedRead())); } static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); @@ -3420,6 +3518,14 @@ class GenericCollapsingQuotientView final { return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); } + ::emboss::support::Maybe IsUndefined() const { + const auto emboss_reserved_local_value = MaybeRead(); + return emboss_reserved_local_value.Known() + ? ::emboss::support::Maybe(false) + : (emboss_reserved_local_value.IsUndefined() + ? ::emboss::support::Maybe(true) + : ::emboss::support::Maybe()); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -3480,6 +3586,9 @@ class GenericCollapsingQuotientView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -3518,6 +3627,9 @@ class GenericCollapsingQuotientView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -3556,6 +3668,9 @@ class GenericCollapsingQuotientView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& diff --git a/testdata/golden_cpp/dynamic_size.emb.h b/testdata/golden_cpp/dynamic_size.emb.h index 4ad358b2..5c1baf5f 100644 --- a/testdata/golden_cpp/dynamic_size.emb.h +++ b/testdata/golden_cpp/dynamic_size.emb.h @@ -153,10 +153,11 @@ class GenericMessageView final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBytes().Ok() && - backing_.SizeInBytes() >= - static_cast( - IntrinsicSizeInBytes().UncheckedRead()); + return IntrinsicSizeInBytes().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBytes().Ok() && + backing_.SizeInBytes() >= + static_cast( + IntrinsicSizeInBytes().UncheckedRead())); } ::std::size_t SizeInBytes() const { return static_cast(IntrinsicSizeInBytes().Read()); @@ -675,6 +676,14 @@ class GenericMessageView final { return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); } + ::emboss::support::Maybe IsUndefined() const { + const auto emboss_reserved_local_value = MaybeRead(); + return emboss_reserved_local_value.Known() + ? ::emboss::support::Maybe(false) + : (emboss_reserved_local_value.IsUndefined() + ? ::emboss::support::Maybe(true) + : ::emboss::support::Maybe()); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -790,6 +799,9 @@ class GenericMessageView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -828,6 +840,9 @@ class GenericMessageView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -965,10 +980,11 @@ class GenericImageView final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBytes().Ok() && - backing_.SizeInBytes() >= - static_cast( - IntrinsicSizeInBytes().UncheckedRead()); + return IntrinsicSizeInBytes().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBytes().Ok() && + backing_.SizeInBytes() >= + static_cast( + IntrinsicSizeInBytes().UncheckedRead())); } ::std::size_t SizeInBytes() const { return static_cast(IntrinsicSizeInBytes().Read()); @@ -1266,6 +1282,14 @@ class GenericImageView final { return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); } + ::emboss::support::Maybe IsUndefined() const { + const auto emboss_reserved_local_value = MaybeRead(); + return emboss_reserved_local_value.Known() + ? ::emboss::support::Maybe(false) + : (emboss_reserved_local_value.IsUndefined() + ? ::emboss::support::Maybe(true) + : ::emboss::support::Maybe()); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -1348,6 +1372,9 @@ class GenericImageView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -1386,6 +1413,9 @@ class GenericImageView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -1535,10 +1565,11 @@ class GenericTwoRegionsView final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBytes().Ok() && - backing_.SizeInBytes() >= - static_cast( - IntrinsicSizeInBytes().UncheckedRead()); + return IntrinsicSizeInBytes().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBytes().Ok() && + backing_.SizeInBytes() >= + static_cast( + IntrinsicSizeInBytes().UncheckedRead())); } ::std::size_t SizeInBytes() const { return static_cast(IntrinsicSizeInBytes().Read()); @@ -2129,6 +2160,14 @@ class GenericTwoRegionsView final { return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); } + ::emboss::support::Maybe IsUndefined() const { + const auto emboss_reserved_local_value = MaybeRead(); + return emboss_reserved_local_value.Known() + ? ::emboss::support::Maybe(false) + : (emboss_reserved_local_value.IsUndefined() + ? ::emboss::support::Maybe(true) + : ::emboss::support::Maybe()); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -2247,6 +2286,9 @@ class GenericTwoRegionsView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -2285,6 +2327,9 @@ class GenericTwoRegionsView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -2428,10 +2473,11 @@ class GenericMultipliedSizeView final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBytes().Ok() && - backing_.SizeInBytes() >= - static_cast( - IntrinsicSizeInBytes().UncheckedRead()); + return IntrinsicSizeInBytes().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBytes().Ok() && + backing_.SizeInBytes() >= + static_cast( + IntrinsicSizeInBytes().UncheckedRead())); } ::std::size_t SizeInBytes() const { return static_cast(IntrinsicSizeInBytes().Read()); @@ -2789,6 +2835,14 @@ class GenericMultipliedSizeView final { return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); } + ::emboss::support::Maybe IsUndefined() const { + const auto emboss_reserved_local_value = MaybeRead(); + return emboss_reserved_local_value.Known() + ? ::emboss::support::Maybe(false) + : (emboss_reserved_local_value.IsUndefined() + ? ::emboss::support::Maybe(true) + : ::emboss::support::Maybe()); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -2878,6 +2932,9 @@ class GenericMultipliedSizeView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -2916,6 +2973,9 @@ class GenericMultipliedSizeView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -3080,10 +3140,11 @@ class GenericNegativeTermsInSizesView final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBytes().Ok() && - backing_.SizeInBytes() >= - static_cast( - IntrinsicSizeInBytes().UncheckedRead()); + return IntrinsicSizeInBytes().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBytes().Ok() && + backing_.SizeInBytes() >= + static_cast( + IntrinsicSizeInBytes().UncheckedRead())); } ::std::size_t SizeInBytes() const { return static_cast(IntrinsicSizeInBytes().Read()); @@ -3929,6 +3990,14 @@ class GenericNegativeTermsInSizesView final { return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); } + ::emboss::support::Maybe IsUndefined() const { + const auto emboss_reserved_local_value = MaybeRead(); + return emboss_reserved_local_value.Known() + ? ::emboss::support::Maybe(false) + : (emboss_reserved_local_value.IsUndefined() + ? ::emboss::support::Maybe(true) + : ::emboss::support::Maybe()); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -4161,6 +4230,9 @@ class GenericNegativeTermsInSizesView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -4199,6 +4271,9 @@ class GenericNegativeTermsInSizesView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -4342,10 +4417,11 @@ class GenericNegativeTermInLocationView final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBytes().Ok() && - backing_.SizeInBytes() >= - static_cast( - IntrinsicSizeInBytes().UncheckedRead()); + return IntrinsicSizeInBytes().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBytes().Ok() && + backing_.SizeInBytes() >= + static_cast( + IntrinsicSizeInBytes().UncheckedRead())); } ::std::size_t SizeInBytes() const { return static_cast(IntrinsicSizeInBytes().Read()); @@ -4622,6 +4698,14 @@ class GenericNegativeTermInLocationView final { return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); } + ::emboss::support::Maybe IsUndefined() const { + const auto emboss_reserved_local_value = MaybeRead(); + return emboss_reserved_local_value.Known() + ? ::emboss::support::Maybe(false) + : (emboss_reserved_local_value.IsUndefined() + ? ::emboss::support::Maybe(true) + : ::emboss::support::Maybe()); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -4704,6 +4788,9 @@ class GenericNegativeTermInLocationView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -4742,6 +4829,9 @@ class GenericNegativeTermInLocationView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -4888,10 +4978,11 @@ class GenericChainedSizeView final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBytes().Ok() && - backing_.SizeInBytes() >= - static_cast( - IntrinsicSizeInBytes().UncheckedRead()); + return IntrinsicSizeInBytes().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBytes().Ok() && + backing_.SizeInBytes() >= + static_cast( + IntrinsicSizeInBytes().UncheckedRead())); } ::std::size_t SizeInBytes() const { return static_cast(IntrinsicSizeInBytes().Read()); @@ -5320,6 +5411,14 @@ class GenericChainedSizeView final { return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); } + ::emboss::support::Maybe IsUndefined() const { + const auto emboss_reserved_local_value = MaybeRead(); + return emboss_reserved_local_value.Known() + ? ::emboss::support::Maybe(false) + : (emboss_reserved_local_value.IsUndefined() + ? ::emboss::support::Maybe(true) + : ::emboss::support::Maybe()); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -5436,6 +5535,9 @@ class GenericChainedSizeView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -5474,6 +5576,9 @@ class GenericChainedSizeView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -5618,10 +5723,11 @@ class GenericFinalFieldOverlapsView final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBytes().Ok() && - backing_.SizeInBytes() >= - static_cast( - IntrinsicSizeInBytes().UncheckedRead()); + return IntrinsicSizeInBytes().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBytes().Ok() && + backing_.SizeInBytes() >= + static_cast( + IntrinsicSizeInBytes().UncheckedRead())); } static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); @@ -5959,6 +6065,9 @@ class GenericFinalFieldOverlapsView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -5997,6 +6106,9 @@ class GenericFinalFieldOverlapsView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -6035,6 +6147,9 @@ class GenericFinalFieldOverlapsView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -6184,10 +6299,11 @@ class GenericDynamicFinalFieldOverlapsView final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBytes().Ok() && - backing_.SizeInBytes() >= - static_cast( - IntrinsicSizeInBytes().UncheckedRead()); + return IntrinsicSizeInBytes().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBytes().Ok() && + backing_.SizeInBytes() >= + static_cast( + IntrinsicSizeInBytes().UncheckedRead())); } ::std::size_t SizeInBytes() const { return static_cast(IntrinsicSizeInBytes().Read()); @@ -6616,6 +6732,14 @@ class GenericDynamicFinalFieldOverlapsView final { return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); } + ::emboss::support::Maybe IsUndefined() const { + const auto emboss_reserved_local_value = MaybeRead(); + return emboss_reserved_local_value.Known() + ? ::emboss::support::Maybe(false) + : (emboss_reserved_local_value.IsUndefined() + ? ::emboss::support::Maybe(true) + : ::emboss::support::Maybe()); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -6712,6 +6836,9 @@ class GenericDynamicFinalFieldOverlapsView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -6750,6 +6877,9 @@ class GenericDynamicFinalFieldOverlapsView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -6897,10 +7027,11 @@ class GenericDynamicFieldDependsOnLaterFieldView final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBytes().Ok() && - backing_.SizeInBytes() >= - static_cast( - IntrinsicSizeInBytes().UncheckedRead()); + return IntrinsicSizeInBytes().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBytes().Ok() && + backing_.SizeInBytes() >= + static_cast( + IntrinsicSizeInBytes().UncheckedRead())); } ::std::size_t SizeInBytes() const { return static_cast(IntrinsicSizeInBytes().Read()); @@ -7179,6 +7310,14 @@ class GenericDynamicFieldDependsOnLaterFieldView final { return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); } + ::emboss::support::Maybe IsUndefined() const { + const auto emboss_reserved_local_value = MaybeRead(); + return emboss_reserved_local_value.Known() + ? ::emboss::support::Maybe(false) + : (emboss_reserved_local_value.IsUndefined() + ? ::emboss::support::Maybe(true) + : ::emboss::support::Maybe()); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -7261,6 +7400,9 @@ class GenericDynamicFieldDependsOnLaterFieldView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -7299,6 +7441,9 @@ class GenericDynamicFieldDependsOnLaterFieldView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -7451,10 +7596,11 @@ class GenericDynamicFieldDoesNotAffectSizeView final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBytes().Ok() && - backing_.SizeInBytes() >= - static_cast( - IntrinsicSizeInBytes().UncheckedRead()); + return IntrinsicSizeInBytes().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBytes().Ok() && + backing_.SizeInBytes() >= + static_cast( + IntrinsicSizeInBytes().UncheckedRead())); } static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); @@ -7792,6 +7938,9 @@ class GenericDynamicFieldDoesNotAffectSizeView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -7830,6 +7979,9 @@ class GenericDynamicFieldDoesNotAffectSizeView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -7868,6 +8020,9 @@ class GenericDynamicFieldDoesNotAffectSizeView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& diff --git a/testdata/golden_cpp/enum.emb.h b/testdata/golden_cpp/enum.emb.h index 816bc7c6..4aca596d 100644 --- a/testdata/golden_cpp/enum.emb.h +++ b/testdata/golden_cpp/enum.emb.h @@ -131,10 +131,11 @@ class GenericConstantsView final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBytes().Ok() && - backing_.SizeInBytes() >= - static_cast( - IntrinsicSizeInBytes().UncheckedRead()); + return IntrinsicSizeInBytes().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBytes().Ok() && + backing_.SizeInBytes() >= + static_cast( + IntrinsicSizeInBytes().UncheckedRead())); } static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); @@ -283,6 +284,9 @@ class GenericConstantsView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -320,6 +324,9 @@ class GenericConstantsView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -357,6 +364,9 @@ class GenericConstantsView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -395,6 +405,9 @@ class GenericConstantsView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -433,6 +446,9 @@ class GenericConstantsView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -1594,9 +1610,11 @@ class GenericEmbossReservedAnonymousField1View final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBits().Ok() && - backing_.SizeInBits() >= static_cast( - IntrinsicSizeInBits().UncheckedRead()); + return IntrinsicSizeInBits().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBits().Ok() && + backing_.SizeInBits() >= + static_cast( + IntrinsicSizeInBits().UncheckedRead())); } static constexpr ::std::size_t SizeInBits() { return static_cast(IntrinsicSizeInBits().Read()); @@ -1785,6 +1803,9 @@ class GenericEmbossReservedAnonymousField1View final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -1823,6 +1844,9 @@ class GenericEmbossReservedAnonymousField1View final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -1861,6 +1885,9 @@ class GenericEmbossReservedAnonymousField1View final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -2016,10 +2043,11 @@ class GenericManifestEntryView final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBytes().Ok() && - backing_.SizeInBytes() >= - static_cast( - IntrinsicSizeInBytes().UncheckedRead()); + return IntrinsicSizeInBytes().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBytes().Ok() && + backing_.SizeInBytes() >= + static_cast( + IntrinsicSizeInBytes().UncheckedRead())); } static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); @@ -2458,6 +2486,9 @@ class GenericManifestEntryView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -2496,6 +2527,9 @@ class GenericManifestEntryView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -2534,6 +2568,9 @@ class GenericManifestEntryView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -2766,10 +2803,11 @@ class GenericStructContainingEnumView final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBytes().Ok() && - backing_.SizeInBytes() >= - static_cast( - IntrinsicSizeInBytes().UncheckedRead()); + return IntrinsicSizeInBytes().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBytes().Ok() && + backing_.SizeInBytes() >= + static_cast( + IntrinsicSizeInBytes().UncheckedRead())); } static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); @@ -2955,6 +2993,9 @@ class GenericStructContainingEnumView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -2993,6 +3034,9 @@ class GenericStructContainingEnumView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -3031,6 +3075,9 @@ class GenericStructContainingEnumView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& diff --git a/testdata/golden_cpp/enum_case.emb.h b/testdata/golden_cpp/enum_case.emb.h index c8ef42cb..5c2bbfab 100644 --- a/testdata/golden_cpp/enum_case.emb.h +++ b/testdata/golden_cpp/enum_case.emb.h @@ -358,10 +358,11 @@ class GenericUseKCamelEnumCaseView final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBytes().Ok() && - backing_.SizeInBytes() >= - static_cast( - IntrinsicSizeInBytes().UncheckedRead()); + return IntrinsicSizeInBytes().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBytes().Ok() && + backing_.SizeInBytes() >= + static_cast( + IntrinsicSizeInBytes().UncheckedRead())); } static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); @@ -585,6 +586,9 @@ class GenericUseKCamelEnumCaseView final { static constexpr ::emboss::test::EnumDefault Read(); static constexpr ::emboss::test::EnumDefault UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -635,6 +639,14 @@ class GenericUseKCamelEnumCaseView final { return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); } + ::emboss::support::Maybe IsUndefined() const { + const auto emboss_reserved_local_value = MaybeRead(); + return emboss_reserved_local_value.Known() + ? ::emboss::support::Maybe(false) + : (emboss_reserved_local_value.IsUndefined() + ? ::emboss::support::Maybe(true) + : ::emboss::support::Maybe()); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -694,6 +706,9 @@ class GenericUseKCamelEnumCaseView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -732,6 +747,9 @@ class GenericUseKCamelEnumCaseView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -770,6 +788,9 @@ class GenericUseKCamelEnumCaseView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& diff --git a/testdata/golden_cpp/explicit_sizes.emb.h b/testdata/golden_cpp/explicit_sizes.emb.h index 008d89ef..60fa205d 100644 --- a/testdata/golden_cpp/explicit_sizes.emb.h +++ b/testdata/golden_cpp/explicit_sizes.emb.h @@ -109,9 +109,11 @@ class GenericSizedUIntArraysView final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBits().Ok() && - backing_.SizeInBits() >= static_cast( - IntrinsicSizeInBits().UncheckedRead()); + return IntrinsicSizeInBits().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBits().Ok() && + backing_.SizeInBits() >= + static_cast( + IntrinsicSizeInBits().UncheckedRead())); } static constexpr ::std::size_t SizeInBits() { return static_cast(IntrinsicSizeInBits().Read()); @@ -455,6 +457,9 @@ class GenericSizedUIntArraysView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -493,6 +498,9 @@ class GenericSizedUIntArraysView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -531,6 +539,9 @@ class GenericSizedUIntArraysView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -675,9 +686,11 @@ class GenericSizedIntArraysView final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBits().Ok() && - backing_.SizeInBits() >= static_cast( - IntrinsicSizeInBits().UncheckedRead()); + return IntrinsicSizeInBits().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBits().Ok() && + backing_.SizeInBits() >= + static_cast( + IntrinsicSizeInBits().UncheckedRead())); } static constexpr ::std::size_t SizeInBits() { return static_cast(IntrinsicSizeInBits().Read()); @@ -1021,6 +1034,9 @@ class GenericSizedIntArraysView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -1059,6 +1075,9 @@ class GenericSizedIntArraysView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -1097,6 +1116,9 @@ class GenericSizedIntArraysView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -1241,9 +1263,11 @@ class GenericSizedEnumArraysView final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBits().Ok() && - backing_.SizeInBits() >= static_cast( - IntrinsicSizeInBits().UncheckedRead()); + return IntrinsicSizeInBits().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBits().Ok() && + backing_.SizeInBits() >= + static_cast( + IntrinsicSizeInBits().UncheckedRead())); } static constexpr ::std::size_t SizeInBits() { return static_cast(IntrinsicSizeInBits().Read()); @@ -1590,6 +1614,9 @@ class GenericSizedEnumArraysView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -1628,6 +1655,9 @@ class GenericSizedEnumArraysView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -1666,6 +1696,9 @@ class GenericSizedEnumArraysView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -1804,10 +1837,11 @@ class GenericBitArrayContainerView final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBytes().Ok() && - backing_.SizeInBytes() >= - static_cast( - IntrinsicSizeInBytes().UncheckedRead()); + return IntrinsicSizeInBytes().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBytes().Ok() && + backing_.SizeInBytes() >= + static_cast( + IntrinsicSizeInBytes().UncheckedRead())); } static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); @@ -1992,6 +2026,9 @@ class GenericBitArrayContainerView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -2030,6 +2067,9 @@ class GenericBitArrayContainerView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -2068,6 +2108,9 @@ class GenericBitArrayContainerView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& diff --git a/testdata/golden_cpp/float.emb.h b/testdata/golden_cpp/float.emb.h index aa75bcb0..eecc8ce0 100644 --- a/testdata/golden_cpp/float.emb.h +++ b/testdata/golden_cpp/float.emb.h @@ -96,10 +96,11 @@ class GenericFloatsView final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBytes().Ok() && - backing_.SizeInBytes() >= - static_cast( - IntrinsicSizeInBytes().UncheckedRead()); + return IntrinsicSizeInBytes().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBytes().Ok() && + backing_.SizeInBytes() >= + static_cast( + IntrinsicSizeInBytes().UncheckedRead())); } static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); @@ -374,6 +375,9 @@ class GenericFloatsView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -412,6 +416,9 @@ class GenericFloatsView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -450,6 +457,9 @@ class GenericFloatsView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -590,10 +600,11 @@ class GenericDoublesView final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBytes().Ok() && - backing_.SizeInBytes() >= - static_cast( - IntrinsicSizeInBytes().UncheckedRead()); + return IntrinsicSizeInBytes().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBytes().Ok() && + backing_.SizeInBytes() >= + static_cast( + IntrinsicSizeInBytes().UncheckedRead())); } static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); @@ -870,6 +881,9 @@ class GenericDoublesView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -908,6 +922,9 @@ class GenericDoublesView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -946,6 +963,9 @@ class GenericDoublesView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& diff --git a/testdata/golden_cpp/imported.emb.h b/testdata/golden_cpp/imported.emb.h index 8f53233b..0bd7d307 100644 --- a/testdata/golden_cpp/imported.emb.h +++ b/testdata/golden_cpp/imported.emb.h @@ -85,10 +85,11 @@ class GenericInnerView final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBytes().Ok() && - backing_.SizeInBytes() >= - static_cast( - IntrinsicSizeInBytes().UncheckedRead()); + return IntrinsicSizeInBytes().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBytes().Ok() && + backing_.SizeInBytes() >= + static_cast( + IntrinsicSizeInBytes().UncheckedRead())); } static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); @@ -274,6 +275,9 @@ class GenericInnerView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -312,6 +316,9 @@ class GenericInnerView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -350,6 +357,9 @@ class GenericInnerView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& diff --git a/testdata/golden_cpp/imported_genfiles.emb.h b/testdata/golden_cpp/imported_genfiles.emb.h index 076b06e0..9a971355 100644 --- a/testdata/golden_cpp/imported_genfiles.emb.h +++ b/testdata/golden_cpp/imported_genfiles.emb.h @@ -86,10 +86,11 @@ class GenericInnerView final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBytes().Ok() && - backing_.SizeInBytes() >= - static_cast( - IntrinsicSizeInBytes().UncheckedRead()); + return IntrinsicSizeInBytes().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBytes().Ok() && + backing_.SizeInBytes() >= + static_cast( + IntrinsicSizeInBytes().UncheckedRead())); } static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); @@ -275,6 +276,9 @@ class GenericInnerView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -313,6 +317,9 @@ class GenericInnerView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -351,6 +358,9 @@ class GenericInnerView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& diff --git a/testdata/golden_cpp/importer.emb.h b/testdata/golden_cpp/importer.emb.h index 30a353c0..8e2bb0d1 100644 --- a/testdata/golden_cpp/importer.emb.h +++ b/testdata/golden_cpp/importer.emb.h @@ -90,10 +90,11 @@ class GenericOuterView final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBytes().Ok() && - backing_.SizeInBytes() >= - static_cast( - IntrinsicSizeInBytes().UncheckedRead()); + return IntrinsicSizeInBytes().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBytes().Ok() && + backing_.SizeInBytes() >= + static_cast( + IntrinsicSizeInBytes().UncheckedRead())); } static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); @@ -345,6 +346,9 @@ class GenericOuterView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -383,6 +387,9 @@ class GenericOuterView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -421,6 +428,9 @@ class GenericOuterView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& diff --git a/testdata/golden_cpp/importer2.emb.h b/testdata/golden_cpp/importer2.emb.h index 8e24a347..220bc5f9 100644 --- a/testdata/golden_cpp/importer2.emb.h +++ b/testdata/golden_cpp/importer2.emb.h @@ -86,10 +86,11 @@ class GenericOuter2View final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBytes().Ok() && - backing_.SizeInBytes() >= - static_cast( - IntrinsicSizeInBytes().UncheckedRead()); + return IntrinsicSizeInBytes().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBytes().Ok() && + backing_.SizeInBytes() >= + static_cast( + IntrinsicSizeInBytes().UncheckedRead())); } static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); @@ -270,6 +271,9 @@ class GenericOuter2View final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -308,6 +312,9 @@ class GenericOuter2View final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -346,6 +353,9 @@ class GenericOuter2View final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& diff --git a/testdata/golden_cpp/inline_type.emb.h b/testdata/golden_cpp/inline_type.emb.h index 0b24980c..4a6978be 100644 --- a/testdata/golden_cpp/inline_type.emb.h +++ b/testdata/golden_cpp/inline_type.emb.h @@ -283,10 +283,11 @@ class GenericFooView final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBytes().Ok() && - backing_.SizeInBytes() >= - static_cast( - IntrinsicSizeInBytes().UncheckedRead()); + return IntrinsicSizeInBytes().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBytes().Ok() && + backing_.SizeInBytes() >= + static_cast( + IntrinsicSizeInBytes().UncheckedRead())); } static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); @@ -554,6 +555,9 @@ class GenericFooView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -592,6 +596,9 @@ class GenericFooView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -630,6 +637,9 @@ class GenericFooView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& diff --git a/testdata/golden_cpp/int_sizes.emb.h b/testdata/golden_cpp/int_sizes.emb.h index 9184ca64..28486ab8 100644 --- a/testdata/golden_cpp/int_sizes.emb.h +++ b/testdata/golden_cpp/int_sizes.emb.h @@ -106,10 +106,11 @@ class GenericSizesView final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBytes().Ok() && - backing_.SizeInBytes() >= - static_cast( - IntrinsicSizeInBytes().UncheckedRead()); + return IntrinsicSizeInBytes().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBytes().Ok() && + backing_.SizeInBytes() >= + static_cast( + IntrinsicSizeInBytes().UncheckedRead())); } static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); @@ -827,6 +828,9 @@ class GenericSizesView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -865,6 +869,9 @@ class GenericSizesView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -903,6 +910,9 @@ class GenericSizesView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& diff --git a/testdata/golden_cpp/large_array.emb.h b/testdata/golden_cpp/large_array.emb.h index c0da21bc..28a1067c 100644 --- a/testdata/golden_cpp/large_array.emb.h +++ b/testdata/golden_cpp/large_array.emb.h @@ -89,10 +89,11 @@ class GenericUIntArrayView final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBytes().Ok() && - backing_.SizeInBytes() >= - static_cast( - IntrinsicSizeInBytes().UncheckedRead()); + return IntrinsicSizeInBytes().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBytes().Ok() && + backing_.SizeInBytes() >= + static_cast( + IntrinsicSizeInBytes().UncheckedRead())); } ::std::size_t SizeInBytes() const { return static_cast(IntrinsicSizeInBytes().Read()); @@ -376,6 +377,14 @@ class GenericUIntArrayView final { return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); } + ::emboss::support::Maybe IsUndefined() const { + const auto emboss_reserved_local_value = MaybeRead(); + return emboss_reserved_local_value.Known() + ? ::emboss::support::Maybe(false) + : (emboss_reserved_local_value.IsUndefined() + ? ::emboss::support::Maybe(true) + : ::emboss::support::Maybe()); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -458,6 +467,9 @@ class GenericUIntArrayView final { static constexpr ::std::int64_t Read(); static constexpr ::std::int64_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -496,6 +508,9 @@ class GenericUIntArrayView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& diff --git a/testdata/golden_cpp/many_conditionals.emb.h b/testdata/golden_cpp/many_conditionals.emb.h index 7f7ee7a9..d3289d65 100644 --- a/testdata/golden_cpp/many_conditionals.emb.h +++ b/testdata/golden_cpp/many_conditionals.emb.h @@ -509,10 +509,11 @@ class GenericLargeConditionalsView final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBytes().Ok() && - backing_.SizeInBytes() >= - static_cast( - IntrinsicSizeInBytes().UncheckedRead()); + return IntrinsicSizeInBytes().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBytes().Ok() && + backing_.SizeInBytes() >= + static_cast( + IntrinsicSizeInBytes().UncheckedRead())); } ::std::size_t SizeInBytes() const { return static_cast(IntrinsicSizeInBytes().Read()); @@ -8389,6 +8390,14 @@ class GenericLargeConditionalsView final { return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); } + ::emboss::support::Maybe IsUndefined() const { + const auto emboss_reserved_local_value = MaybeRead(); + return emboss_reserved_local_value.Known() + ? ::emboss::support::Maybe(false) + : (emboss_reserved_local_value.IsUndefined() + ? ::emboss::support::Maybe(true) + : ::emboss::support::Maybe()); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -9934,6 +9943,9 @@ class GenericLargeConditionalsView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -9972,6 +9984,9 @@ class GenericLargeConditionalsView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -10146,10 +10161,11 @@ class GenericDisjunctionConditionalsView final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBytes().Ok() && - backing_.SizeInBytes() >= - static_cast( - IntrinsicSizeInBytes().UncheckedRead()); + return IntrinsicSizeInBytes().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBytes().Ok() && + backing_.SizeInBytes() >= + static_cast( + IntrinsicSizeInBytes().UncheckedRead())); } ::std::size_t SizeInBytes() const { return static_cast(IntrinsicSizeInBytes().Read()); @@ -10579,6 +10595,14 @@ class GenericDisjunctionConditionalsView final { return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); } + ::emboss::support::Maybe IsUndefined() const { + const auto emboss_reserved_local_value = MaybeRead(); + return emboss_reserved_local_value.Known() + ? ::emboss::support::Maybe(false) + : (emboss_reserved_local_value.IsUndefined() + ? ::emboss::support::Maybe(true) + : ::emboss::support::Maybe()); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -10732,6 +10756,9 @@ class GenericDisjunctionConditionalsView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -10770,6 +10797,9 @@ class GenericDisjunctionConditionalsView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& diff --git a/testdata/golden_cpp/nested_structure.emb.h b/testdata/golden_cpp/nested_structure.emb.h index dab6ae3a..467b4c74 100644 --- a/testdata/golden_cpp/nested_structure.emb.h +++ b/testdata/golden_cpp/nested_structure.emb.h @@ -102,10 +102,11 @@ class GenericContainerView final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBytes().Ok() && - backing_.SizeInBytes() >= - static_cast( - IntrinsicSizeInBytes().UncheckedRead()); + return IntrinsicSizeInBytes().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBytes().Ok() && + backing_.SizeInBytes() >= + static_cast( + IntrinsicSizeInBytes().UncheckedRead())); } static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); @@ -435,6 +436,9 @@ class GenericContainerView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -473,6 +477,9 @@ class GenericContainerView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -511,6 +518,9 @@ class GenericContainerView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -650,10 +660,11 @@ class GenericBoxView final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBytes().Ok() && - backing_.SizeInBytes() >= - static_cast( - IntrinsicSizeInBytes().UncheckedRead()); + return IntrinsicSizeInBytes().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBytes().Ok() && + backing_.SizeInBytes() >= + static_cast( + IntrinsicSizeInBytes().UncheckedRead())); } static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); @@ -914,6 +925,9 @@ class GenericBoxView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -952,6 +966,9 @@ class GenericBoxView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -990,6 +1007,9 @@ class GenericBoxView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -1127,10 +1147,11 @@ class GenericTruckView final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBytes().Ok() && - backing_.SizeInBytes() >= - static_cast( - IntrinsicSizeInBytes().UncheckedRead()); + return IntrinsicSizeInBytes().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBytes().Ok() && + backing_.SizeInBytes() >= + static_cast( + IntrinsicSizeInBytes().UncheckedRead())); } static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); @@ -1392,6 +1413,9 @@ class GenericTruckView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -1430,6 +1454,9 @@ class GenericTruckView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -1468,6 +1495,9 @@ class GenericTruckView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& diff --git a/testdata/golden_cpp/next_keyword.emb.h b/testdata/golden_cpp/next_keyword.emb.h index a3b2db06..bdee0fe5 100644 --- a/testdata/golden_cpp/next_keyword.emb.h +++ b/testdata/golden_cpp/next_keyword.emb.h @@ -95,10 +95,11 @@ class GenericNextKeywordView final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBytes().Ok() && - backing_.SizeInBytes() >= - static_cast( - IntrinsicSizeInBytes().UncheckedRead()); + return IntrinsicSizeInBytes().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBytes().Ok() && + backing_.SizeInBytes() >= + static_cast( + IntrinsicSizeInBytes().UncheckedRead())); } static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); @@ -514,6 +515,9 @@ class GenericNextKeywordView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -552,6 +556,9 @@ class GenericNextKeywordView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -590,6 +597,9 @@ class GenericNextKeywordView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& diff --git a/testdata/golden_cpp/no_enum_traits.emb.h b/testdata/golden_cpp/no_enum_traits.emb.h index 14c9ba23..7d6787d7 100644 --- a/testdata/golden_cpp/no_enum_traits.emb.h +++ b/testdata/golden_cpp/no_enum_traits.emb.h @@ -164,10 +164,11 @@ class GenericBarView final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBytes().Ok() && - backing_.SizeInBytes() >= - static_cast( - IntrinsicSizeInBytes().UncheckedRead()); + return IntrinsicSizeInBytes().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBytes().Ok() && + backing_.SizeInBytes() >= + static_cast( + IntrinsicSizeInBytes().UncheckedRead())); } static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); @@ -353,6 +354,9 @@ class GenericBarView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -391,6 +395,9 @@ class GenericBarView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -429,6 +436,9 @@ class GenericBarView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& diff --git a/testdata/golden_cpp/parameters.emb.h b/testdata/golden_cpp/parameters.emb.h index 586bfdc7..ccc821ed 100644 --- a/testdata/golden_cpp/parameters.emb.h +++ b/testdata/golden_cpp/parameters.emb.h @@ -398,10 +398,11 @@ class GenericMultiVersionView final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBytes().Ok() && - backing_.SizeInBytes() >= - static_cast( - IntrinsicSizeInBytes().UncheckedRead()); + return IntrinsicSizeInBytes().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBytes().Ok() && + backing_.SizeInBytes() >= + static_cast( + IntrinsicSizeInBytes().UncheckedRead())); } ::std::size_t SizeInBytes() const { return static_cast(IntrinsicSizeInBytes().Read()); @@ -858,6 +859,14 @@ class GenericMultiVersionView final { return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); } + ::emboss::support::Maybe IsUndefined() const { + const auto emboss_reserved_local_value = MaybeRead(); + return emboss_reserved_local_value.Known() + ? ::emboss::support::Maybe(false) + : (emboss_reserved_local_value.IsUndefined() + ? ::emboss::support::Maybe(true) + : ::emboss::support::Maybe()); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -976,6 +985,9 @@ class GenericMultiVersionView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -1014,6 +1026,9 @@ class GenericMultiVersionView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -1185,10 +1200,11 @@ class GenericAxesView final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBytes().Ok() && - backing_.SizeInBytes() >= - static_cast( - IntrinsicSizeInBytes().UncheckedRead()); + return IntrinsicSizeInBytes().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBytes().Ok() && + backing_.SizeInBytes() >= + static_cast( + IntrinsicSizeInBytes().UncheckedRead())); } ::std::size_t SizeInBytes() const { return static_cast(IntrinsicSizeInBytes().Read()); @@ -1661,6 +1677,14 @@ class GenericAxesView final { return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); } + ::emboss::support::Maybe IsUndefined() const { + const auto emboss_reserved_local_value = MaybeRead(); + return emboss_reserved_local_value.Known() + ? ::emboss::support::Maybe(false) + : (emboss_reserved_local_value.IsUndefined() + ? ::emboss::support::Maybe(true) + : ::emboss::support::Maybe()); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -1735,6 +1759,14 @@ class GenericAxesView final { return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); } + ::emboss::support::Maybe IsUndefined() const { + const auto emboss_reserved_local_value = MaybeRead(); + return emboss_reserved_local_value.Known() + ? ::emboss::support::Maybe(false) + : (emboss_reserved_local_value.IsUndefined() + ? ::emboss::support::Maybe(true) + : ::emboss::support::Maybe()); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -1857,6 +1889,9 @@ class GenericAxesView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -1895,6 +1930,9 @@ class GenericAxesView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -2065,10 +2103,11 @@ class GenericAxisPairView final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBytes().Ok() && - backing_.SizeInBytes() >= - static_cast( - IntrinsicSizeInBytes().UncheckedRead()); + return IntrinsicSizeInBytes().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBytes().Ok() && + backing_.SizeInBytes() >= + static_cast( + IntrinsicSizeInBytes().UncheckedRead())); } static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); @@ -2455,6 +2494,14 @@ class GenericAxisPairView final { return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); } + ::emboss::support::Maybe IsUndefined() const { + const auto emboss_reserved_local_value = MaybeRead(); + return emboss_reserved_local_value.Known() + ? ::emboss::support::Maybe(false) + : (emboss_reserved_local_value.IsUndefined() + ? ::emboss::support::Maybe(true) + : ::emboss::support::Maybe()); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -2531,6 +2578,14 @@ class GenericAxisPairView final { return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); } + ::emboss::support::Maybe IsUndefined() const { + const auto emboss_reserved_local_value = MaybeRead(); + return emboss_reserved_local_value.Known() + ? ::emboss::support::Maybe(false) + : (emboss_reserved_local_value.IsUndefined() + ? ::emboss::support::Maybe(true) + : ::emboss::support::Maybe()); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -2592,6 +2647,9 @@ class GenericAxisPairView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -2630,6 +2688,9 @@ class GenericAxisPairView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -2668,6 +2729,9 @@ class GenericAxisPairView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -2823,10 +2887,11 @@ class GenericAxesEnvelopeView final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBytes().Ok() && - backing_.SizeInBytes() >= - static_cast( - IntrinsicSizeInBytes().UncheckedRead()); + return IntrinsicSizeInBytes().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBytes().Ok() && + backing_.SizeInBytes() >= + static_cast( + IntrinsicSizeInBytes().UncheckedRead())); } ::std::size_t SizeInBytes() const { return static_cast(IntrinsicSizeInBytes().Read()); @@ -3098,6 +3163,14 @@ class GenericAxesEnvelopeView final { return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); } + ::emboss::support::Maybe IsUndefined() const { + const auto emboss_reserved_local_value = MaybeRead(); + return emboss_reserved_local_value.Known() + ? ::emboss::support::Maybe(false) + : (emboss_reserved_local_value.IsUndefined() + ? ::emboss::support::Maybe(true) + : ::emboss::support::Maybe()); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -3180,6 +3253,9 @@ class GenericAxesEnvelopeView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -3218,6 +3294,9 @@ class GenericAxesEnvelopeView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -3516,10 +3595,11 @@ class GenericAxisView final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBytes().Ok() && - backing_.SizeInBytes() >= - static_cast( - IntrinsicSizeInBytes().UncheckedRead()); + return IntrinsicSizeInBytes().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBytes().Ok() && + backing_.SizeInBytes() >= + static_cast( + IntrinsicSizeInBytes().UncheckedRead())); } static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); @@ -3975,6 +4055,14 @@ class GenericAxisView final { return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); } + ::emboss::support::Maybe IsUndefined() const { + const auto emboss_reserved_local_value = MaybeRead(); + return emboss_reserved_local_value.Known() + ? ::emboss::support::Maybe(false) + : (emboss_reserved_local_value.IsUndefined() + ? ::emboss::support::Maybe(true) + : ::emboss::support::Maybe()); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -4064,6 +4152,9 @@ class GenericAxisView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -4102,6 +4193,9 @@ class GenericAxisView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -4140,6 +4234,9 @@ class GenericAxisView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -4283,9 +4380,11 @@ class GenericConfigView final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBits().Ok() && - backing_.SizeInBits() >= static_cast( - IntrinsicSizeInBits().UncheckedRead()); + return IntrinsicSizeInBits().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBits().Ok() && + backing_.SizeInBits() >= + static_cast( + IntrinsicSizeInBits().UncheckedRead())); } static constexpr ::std::size_t SizeInBits() { return static_cast(IntrinsicSizeInBits().Read()); @@ -4467,6 +4566,9 @@ class GenericConfigView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -4505,6 +4607,9 @@ class GenericConfigView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -4543,6 +4648,9 @@ class GenericConfigView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -4686,9 +4794,11 @@ class GenericEmbossReservedAnonymousField1View final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBits().Ok() && - backing_.SizeInBits() >= static_cast( - IntrinsicSizeInBits().UncheckedRead()); + return IntrinsicSizeInBits().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBits().Ok() && + backing_.SizeInBits() >= + static_cast( + IntrinsicSizeInBits().UncheckedRead())); } static constexpr ::std::size_t SizeInBits() { return static_cast(IntrinsicSizeInBits().Read()); @@ -4870,6 +4980,9 @@ class GenericEmbossReservedAnonymousField1View final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -4908,6 +5021,9 @@ class GenericEmbossReservedAnonymousField1View final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -4946,6 +5062,9 @@ class GenericEmbossReservedAnonymousField1View final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -5093,10 +5212,11 @@ class GenericConfigVXView final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBytes().Ok() && - backing_.SizeInBytes() >= - static_cast( - IntrinsicSizeInBytes().UncheckedRead()); + return IntrinsicSizeInBytes().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBytes().Ok() && + backing_.SizeInBytes() >= + static_cast( + IntrinsicSizeInBytes().UncheckedRead())); } static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); @@ -5375,6 +5495,9 @@ class GenericConfigVXView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -5413,6 +5536,9 @@ class GenericConfigVXView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -5451,6 +5577,9 @@ class GenericConfigVXView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -5600,10 +5729,11 @@ class GenericStructWithUnusedParameterView final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBytes().Ok() && - backing_.SizeInBytes() >= - static_cast( - IntrinsicSizeInBytes().UncheckedRead()); + return IntrinsicSizeInBytes().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBytes().Ok() && + backing_.SizeInBytes() >= + static_cast( + IntrinsicSizeInBytes().UncheckedRead())); } static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); @@ -5827,6 +5957,9 @@ class GenericStructWithUnusedParameterView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -5865,6 +5998,9 @@ class GenericStructWithUnusedParameterView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -5903,6 +6039,9 @@ class GenericStructWithUnusedParameterView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -6059,10 +6198,11 @@ class GenericStructContainingStructWithUnusedParameterView final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBytes().Ok() && - backing_.SizeInBytes() >= - static_cast( - IntrinsicSizeInBytes().UncheckedRead()); + return IntrinsicSizeInBytes().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBytes().Ok() && + backing_.SizeInBytes() >= + static_cast( + IntrinsicSizeInBytes().UncheckedRead())); } static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); @@ -6323,6 +6463,9 @@ class GenericStructContainingStructWithUnusedParameterView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -6361,6 +6504,9 @@ class GenericStructContainingStructWithUnusedParameterView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -6399,6 +6545,9 @@ class GenericStructContainingStructWithUnusedParameterView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -6557,10 +6706,11 @@ class GenericBiasedValueView final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBytes().Ok() && - backing_.SizeInBytes() >= - static_cast( - IntrinsicSizeInBytes().UncheckedRead()); + return IntrinsicSizeInBytes().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBytes().Ok() && + backing_.SizeInBytes() >= + static_cast( + IntrinsicSizeInBytes().UncheckedRead())); } static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); @@ -6818,6 +6968,14 @@ class GenericBiasedValueView final { return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); } + ::emboss::support::Maybe IsUndefined() const { + const auto emboss_reserved_local_value = MaybeRead(); + return emboss_reserved_local_value.Known() + ? ::emboss::support::Maybe(false) + : (emboss_reserved_local_value.IsUndefined() + ? ::emboss::support::Maybe(true) + : ::emboss::support::Maybe()); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -6882,6 +7040,9 @@ class GenericBiasedValueView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -6920,6 +7081,9 @@ class GenericBiasedValueView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -6958,6 +7122,9 @@ class GenericBiasedValueView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -7116,10 +7283,11 @@ class GenericVirtualFirstFieldWithParamView final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBytes().Ok() && - backing_.SizeInBytes() >= - static_cast( - IntrinsicSizeInBytes().UncheckedRead()); + return IntrinsicSizeInBytes().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBytes().Ok() && + backing_.SizeInBytes() >= + static_cast( + IntrinsicSizeInBytes().UncheckedRead())); } static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); @@ -7387,6 +7555,9 @@ class GenericVirtualFirstFieldWithParamView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -7425,6 +7596,9 @@ class GenericVirtualFirstFieldWithParamView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -7463,6 +7637,9 @@ class GenericVirtualFirstFieldWithParamView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -7628,10 +7805,11 @@ class GenericConstVirtualFirstFieldWithParamView final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBytes().Ok() && - backing_.SizeInBytes() >= - static_cast( - IntrinsicSizeInBytes().UncheckedRead()); + return IntrinsicSizeInBytes().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBytes().Ok() && + backing_.SizeInBytes() >= + static_cast( + IntrinsicSizeInBytes().UncheckedRead())); } static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); @@ -7863,6 +8041,9 @@ class GenericConstVirtualFirstFieldWithParamView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -7912,6 +8093,9 @@ class GenericConstVirtualFirstFieldWithParamView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -7950,6 +8134,9 @@ class GenericConstVirtualFirstFieldWithParamView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -7988,6 +8175,9 @@ class GenericConstVirtualFirstFieldWithParamView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -8145,10 +8335,11 @@ class GenericSizedArrayOfBiasedValuesView final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBytes().Ok() && - backing_.SizeInBytes() >= - static_cast( - IntrinsicSizeInBytes().UncheckedRead()); + return IntrinsicSizeInBytes().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBytes().Ok() && + backing_.SizeInBytes() >= + static_cast( + IntrinsicSizeInBytes().UncheckedRead())); } ::std::size_t SizeInBytes() const { return static_cast(IntrinsicSizeInBytes().Read()); @@ -8504,6 +8695,14 @@ class GenericSizedArrayOfBiasedValuesView final { return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); } + ::emboss::support::Maybe IsUndefined() const { + const auto emboss_reserved_local_value = MaybeRead(); + return emboss_reserved_local_value.Known() + ? ::emboss::support::Maybe(false) + : (emboss_reserved_local_value.IsUndefined() + ? ::emboss::support::Maybe(true) + : ::emboss::support::Maybe()); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -8582,6 +8781,9 @@ class GenericSizedArrayOfBiasedValuesView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -8620,6 +8822,9 @@ class GenericSizedArrayOfBiasedValuesView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& diff --git a/testdata/golden_cpp/requires.emb.h b/testdata/golden_cpp/requires.emb.h index 4940c581..f0b8f669 100644 --- a/testdata/golden_cpp/requires.emb.h +++ b/testdata/golden_cpp/requires.emb.h @@ -261,10 +261,11 @@ class GenericRequiresIntegersView final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBytes().Ok() && - backing_.SizeInBytes() >= - static_cast( - IntrinsicSizeInBytes().UncheckedRead()); + return IntrinsicSizeInBytes().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBytes().Ok() && + backing_.SizeInBytes() >= + static_cast( + IntrinsicSizeInBytes().UncheckedRead())); } static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); @@ -730,6 +731,14 @@ class GenericRequiresIntegersView final { return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); } + ::emboss::support::Maybe IsUndefined() const { + const auto emboss_reserved_local_value = MaybeRead(); + return emboss_reserved_local_value.Known() + ? ::emboss::support::Maybe(false) + : (emboss_reserved_local_value.IsUndefined() + ? ::emboss::support::Maybe(true) + : ::emboss::support::Maybe()); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -822,6 +831,14 @@ class GenericRequiresIntegersView final { return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); } + ::emboss::support::Maybe IsUndefined() const { + const auto emboss_reserved_local_value = MaybeRead(); + return emboss_reserved_local_value.Known() + ? ::emboss::support::Maybe(false) + : (emboss_reserved_local_value.IsUndefined() + ? ::emboss::support::Maybe(true) + : ::emboss::support::Maybe()); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -938,6 +955,14 @@ class GenericRequiresIntegersView final { return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); } + ::emboss::support::Maybe IsUndefined() const { + const auto emboss_reserved_local_value = MaybeRead(); + return emboss_reserved_local_value.Known() + ? ::emboss::support::Maybe(false) + : (emboss_reserved_local_value.IsUndefined() + ? ::emboss::support::Maybe(true) + : ::emboss::support::Maybe()); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -1060,6 +1085,9 @@ class GenericRequiresIntegersView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -1098,6 +1126,9 @@ class GenericRequiresIntegersView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -1136,6 +1167,9 @@ class GenericRequiresIntegersView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -1320,9 +1354,11 @@ class GenericEmbossReservedAnonymousField2View final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBits().Ok() && - backing_.SizeInBits() >= static_cast( - IntrinsicSizeInBits().UncheckedRead()); + return IntrinsicSizeInBits().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBits().Ok() && + backing_.SizeInBits() >= + static_cast( + IntrinsicSizeInBits().UncheckedRead())); } static constexpr ::std::size_t SizeInBits() { return static_cast(IntrinsicSizeInBits().Read()); @@ -1729,6 +1765,9 @@ class GenericEmbossReservedAnonymousField2View final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -1767,6 +1806,9 @@ class GenericEmbossReservedAnonymousField2View final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -1805,6 +1847,9 @@ class GenericEmbossReservedAnonymousField2View final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -1979,10 +2024,11 @@ class GenericRequiresBoolsView final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBytes().Ok() && - backing_.SizeInBytes() >= - static_cast( - IntrinsicSizeInBytes().UncheckedRead()); + return IntrinsicSizeInBytes().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBytes().Ok() && + backing_.SizeInBytes() >= + static_cast( + IntrinsicSizeInBytes().UncheckedRead())); } static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); @@ -2399,6 +2445,14 @@ class GenericRequiresBoolsView final { return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); } + ::emboss::support::Maybe IsUndefined() const { + const auto emboss_reserved_local_value = MaybeRead(); + return emboss_reserved_local_value.Known() + ? ::emboss::support::Maybe(false) + : (emboss_reserved_local_value.IsUndefined() + ? ::emboss::support::Maybe(true) + : ::emboss::support::Maybe()); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -2468,6 +2522,14 @@ class GenericRequiresBoolsView final { return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); } + ::emboss::support::Maybe IsUndefined() const { + const auto emboss_reserved_local_value = MaybeRead(); + return emboss_reserved_local_value.Known() + ? ::emboss::support::Maybe(false) + : (emboss_reserved_local_value.IsUndefined() + ? ::emboss::support::Maybe(true) + : ::emboss::support::Maybe()); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -2554,6 +2616,9 @@ class GenericRequiresBoolsView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -2592,6 +2657,9 @@ class GenericRequiresBoolsView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -2630,6 +2698,9 @@ class GenericRequiresBoolsView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -2964,10 +3035,11 @@ class GenericRequiresEnumsView final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBytes().Ok() && - backing_.SizeInBytes() >= - static_cast( - IntrinsicSizeInBytes().UncheckedRead()); + return IntrinsicSizeInBytes().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBytes().Ok() && + backing_.SizeInBytes() >= + static_cast( + IntrinsicSizeInBytes().UncheckedRead())); } static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); @@ -3379,6 +3451,14 @@ class GenericRequiresEnumsView final { return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); } + ::emboss::support::Maybe IsUndefined() const { + const auto emboss_reserved_local_value = MaybeRead(); + return emboss_reserved_local_value.Known() + ? ::emboss::support::Maybe(false) + : (emboss_reserved_local_value.IsUndefined() + ? ::emboss::support::Maybe(true) + : ::emboss::support::Maybe()); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -3475,6 +3555,14 @@ class GenericRequiresEnumsView final { return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); } + ::emboss::support::Maybe IsUndefined() const { + const auto emboss_reserved_local_value = MaybeRead(); + return emboss_reserved_local_value.Known() + ? ::emboss::support::Maybe(false) + : (emboss_reserved_local_value.IsUndefined() + ? ::emboss::support::Maybe(true) + : ::emboss::support::Maybe()); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -3578,6 +3666,9 @@ class GenericRequiresEnumsView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -3616,6 +3707,9 @@ class GenericRequiresEnumsView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -3654,6 +3748,9 @@ class GenericRequiresEnumsView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -3821,9 +3918,11 @@ class GenericEmbossReservedAnonymousField1View final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBits().Ok() && - backing_.SizeInBits() >= static_cast( - IntrinsicSizeInBits().UncheckedRead()); + return IntrinsicSizeInBits().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBits().Ok() && + backing_.SizeInBits() >= + static_cast( + IntrinsicSizeInBits().UncheckedRead())); } ::std::size_t SizeInBits() const { return static_cast(IntrinsicSizeInBits().Read()); @@ -4240,6 +4339,14 @@ class GenericEmbossReservedAnonymousField1View final { return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); } + ::emboss::support::Maybe IsUndefined() const { + const auto emboss_reserved_local_value = MaybeRead(); + return emboss_reserved_local_value.Known() + ? ::emboss::support::Maybe(false) + : (emboss_reserved_local_value.IsUndefined() + ? ::emboss::support::Maybe(true) + : ::emboss::support::Maybe()); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -4311,6 +4418,9 @@ class GenericEmbossReservedAnonymousField1View final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -4349,6 +4459,9 @@ class GenericEmbossReservedAnonymousField1View final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -4515,10 +4628,11 @@ class GenericRequiresWithOptionalFieldsView final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBytes().Ok() && - backing_.SizeInBytes() >= - static_cast( - IntrinsicSizeInBytes().UncheckedRead()); + return IntrinsicSizeInBytes().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBytes().Ok() && + backing_.SizeInBytes() >= + static_cast( + IntrinsicSizeInBytes().UncheckedRead())); } static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); @@ -4859,6 +4973,9 @@ class GenericRequiresWithOptionalFieldsView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -4897,6 +5014,9 @@ class GenericRequiresWithOptionalFieldsView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -4935,6 +5055,9 @@ class GenericRequiresWithOptionalFieldsView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -5097,10 +5220,11 @@ class GenericElementView final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBytes().Ok() && - backing_.SizeInBytes() >= - static_cast( - IntrinsicSizeInBytes().UncheckedRead()); + return IntrinsicSizeInBytes().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBytes().Ok() && + backing_.SizeInBytes() >= + static_cast( + IntrinsicSizeInBytes().UncheckedRead())); } static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); @@ -5286,6 +5410,9 @@ class GenericElementView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -5324,6 +5451,9 @@ class GenericElementView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -5362,6 +5492,9 @@ class GenericElementView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -5499,10 +5632,11 @@ class GenericRequiresInArrayElementsView final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBytes().Ok() && - backing_.SizeInBytes() >= - static_cast( - IntrinsicSizeInBytes().UncheckedRead()); + return IntrinsicSizeInBytes().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBytes().Ok() && + backing_.SizeInBytes() >= + static_cast( + IntrinsicSizeInBytes().UncheckedRead())); } static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); @@ -5688,6 +5822,9 @@ class GenericRequiresInArrayElementsView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -5726,6 +5863,9 @@ class GenericRequiresInArrayElementsView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -5764,6 +5904,9 @@ class GenericRequiresInArrayElementsView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& diff --git a/testdata/golden_cpp/start_size_range.emb.h b/testdata/golden_cpp/start_size_range.emb.h index d1025994..3a395f5a 100644 --- a/testdata/golden_cpp/start_size_range.emb.h +++ b/testdata/golden_cpp/start_size_range.emb.h @@ -96,10 +96,11 @@ class GenericStartSizeView final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBytes().Ok() && - backing_.SizeInBytes() >= - static_cast( - IntrinsicSizeInBytes().UncheckedRead()); + return IntrinsicSizeInBytes().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBytes().Ok() && + backing_.SizeInBytes() >= + static_cast( + IntrinsicSizeInBytes().UncheckedRead())); } ::std::size_t SizeInBytes() const { return static_cast(IntrinsicSizeInBytes().Read()); @@ -542,6 +543,14 @@ class GenericStartSizeView final { return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); } + ::emboss::support::Maybe IsUndefined() const { + const auto emboss_reserved_local_value = MaybeRead(); + return emboss_reserved_local_value.Known() + ? ::emboss::support::Maybe(false) + : (emboss_reserved_local_value.IsUndefined() + ? ::emboss::support::Maybe(true) + : ::emboss::support::Maybe()); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -632,6 +641,9 @@ class GenericStartSizeView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -670,6 +682,9 @@ class GenericStartSizeView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& diff --git a/testdata/golden_cpp/subtypes.emb.h b/testdata/golden_cpp/subtypes.emb.h index d7895cf2..cf2e3b64 100644 --- a/testdata/golden_cpp/subtypes.emb.h +++ b/testdata/golden_cpp/subtypes.emb.h @@ -209,10 +209,11 @@ class GenericInInView final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBytes().Ok() && - backing_.SizeInBytes() >= - static_cast( - IntrinsicSizeInBytes().UncheckedRead()); + return IntrinsicSizeInBytes().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBytes().Ok() && + backing_.SizeInBytes() >= + static_cast( + IntrinsicSizeInBytes().UncheckedRead())); } static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); @@ -468,6 +469,9 @@ class GenericInInView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -525,6 +529,9 @@ class GenericInInView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -563,6 +570,9 @@ class GenericInInView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -601,6 +611,9 @@ class GenericInInView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -752,10 +765,11 @@ class GenericInView final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBytes().Ok() && - backing_.SizeInBytes() >= - static_cast( - IntrinsicSizeInBytes().UncheckedRead()); + return IntrinsicSizeInBytes().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBytes().Ok() && + backing_.SizeInBytes() >= + static_cast( + IntrinsicSizeInBytes().UncheckedRead())); } ::std::size_t SizeInBytes() const { return static_cast(IntrinsicSizeInBytes().Read()); @@ -1331,6 +1345,14 @@ class GenericInView final { return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); } + ::emboss::support::Maybe IsUndefined() const { + const auto emboss_reserved_local_value = MaybeRead(); + return emboss_reserved_local_value.Known() + ? ::emboss::support::Maybe(false) + : (emboss_reserved_local_value.IsUndefined() + ? ::emboss::support::Maybe(true) + : ::emboss::support::Maybe()); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -1414,6 +1436,9 @@ class GenericInView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -1452,6 +1477,9 @@ class GenericInView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -1585,10 +1613,11 @@ class GenericIn2View final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBytes().Ok() && - backing_.SizeInBytes() >= - static_cast( - IntrinsicSizeInBytes().UncheckedRead()); + return IntrinsicSizeInBytes().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBytes().Ok() && + backing_.SizeInBytes() >= + static_cast( + IntrinsicSizeInBytes().UncheckedRead())); } static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); @@ -1773,6 +1802,9 @@ class GenericIn2View final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -1811,6 +1843,9 @@ class GenericIn2View final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -1849,6 +1884,9 @@ class GenericIn2View final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -2007,10 +2045,11 @@ class GenericOutView final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBytes().Ok() && - backing_.SizeInBytes() >= - static_cast( - IntrinsicSizeInBytes().UncheckedRead()); + return IntrinsicSizeInBytes().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBytes().Ok() && + backing_.SizeInBytes() >= + static_cast( + IntrinsicSizeInBytes().UncheckedRead())); } static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); @@ -2723,6 +2762,9 @@ class GenericOutView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -2761,6 +2803,9 @@ class GenericOutView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -2799,6 +2844,9 @@ class GenericOutView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& diff --git a/testdata/golden_cpp/text_format.emb.h b/testdata/golden_cpp/text_format.emb.h index d15b5ac5..471e3dd6 100644 --- a/testdata/golden_cpp/text_format.emb.h +++ b/testdata/golden_cpp/text_format.emb.h @@ -100,10 +100,11 @@ class GenericVanillaView final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBytes().Ok() && - backing_.SizeInBytes() >= - static_cast( - IntrinsicSizeInBytes().UncheckedRead()); + return IntrinsicSizeInBytes().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBytes().Ok() && + backing_.SizeInBytes() >= + static_cast( + IntrinsicSizeInBytes().UncheckedRead())); } static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); @@ -365,6 +366,9 @@ class GenericVanillaView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -403,6 +407,9 @@ class GenericVanillaView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -441,6 +448,9 @@ class GenericVanillaView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -584,10 +594,11 @@ class GenericStructWithSkippedFieldsView final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBytes().Ok() && - backing_.SizeInBytes() >= - static_cast( - IntrinsicSizeInBytes().UncheckedRead()); + return IntrinsicSizeInBytes().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBytes().Ok() && + backing_.SizeInBytes() >= + static_cast( + IntrinsicSizeInBytes().UncheckedRead())); } static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); @@ -895,6 +906,9 @@ class GenericStructWithSkippedFieldsView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -933,6 +947,9 @@ class GenericStructWithSkippedFieldsView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -971,6 +988,9 @@ class GenericStructWithSkippedFieldsView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -1121,10 +1141,11 @@ class GenericStructWithSkippedStructureFieldsView final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBytes().Ok() && - backing_.SizeInBytes() >= - static_cast( - IntrinsicSizeInBytes().UncheckedRead()); + return IntrinsicSizeInBytes().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBytes().Ok() && + backing_.SizeInBytes() >= + static_cast( + IntrinsicSizeInBytes().UncheckedRead())); } static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); @@ -1418,6 +1439,9 @@ class GenericStructWithSkippedStructureFieldsView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -1456,6 +1480,9 @@ class GenericStructWithSkippedStructureFieldsView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -1494,6 +1521,9 @@ class GenericStructWithSkippedStructureFieldsView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& diff --git a/testdata/golden_cpp/uint_sizes.emb.h b/testdata/golden_cpp/uint_sizes.emb.h index 5ca7e89e..7aba8057 100644 --- a/testdata/golden_cpp/uint_sizes.emb.h +++ b/testdata/golden_cpp/uint_sizes.emb.h @@ -143,10 +143,11 @@ class GenericSizesView final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBytes().Ok() && - backing_.SizeInBytes() >= - static_cast( - IntrinsicSizeInBytes().UncheckedRead()); + return IntrinsicSizeInBytes().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBytes().Ok() && + backing_.SizeInBytes() >= + static_cast( + IntrinsicSizeInBytes().UncheckedRead())); } static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); @@ -864,6 +865,9 @@ class GenericSizesView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -902,6 +906,9 @@ class GenericSizesView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -940,6 +947,9 @@ class GenericSizesView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -1096,10 +1106,11 @@ class GenericBigEndianSizesView final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBytes().Ok() && - backing_.SizeInBytes() >= - static_cast( - IntrinsicSizeInBytes().UncheckedRead()); + return IntrinsicSizeInBytes().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBytes().Ok() && + backing_.SizeInBytes() >= + static_cast( + IntrinsicSizeInBytes().UncheckedRead())); } static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); @@ -1817,6 +1828,9 @@ class GenericBigEndianSizesView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -1855,6 +1869,9 @@ class GenericBigEndianSizesView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -1893,6 +1910,9 @@ class GenericBigEndianSizesView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -2054,10 +2074,11 @@ class GenericAlternatingEndianSizesView final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBytes().Ok() && - backing_.SizeInBytes() >= - static_cast( - IntrinsicSizeInBytes().UncheckedRead()); + return IntrinsicSizeInBytes().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBytes().Ok() && + backing_.SizeInBytes() >= + static_cast( + IntrinsicSizeInBytes().UncheckedRead())); } static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); @@ -2775,6 +2796,9 @@ class GenericAlternatingEndianSizesView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -2813,6 +2837,9 @@ class GenericAlternatingEndianSizesView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -2851,6 +2878,9 @@ class GenericAlternatingEndianSizesView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -3009,10 +3039,11 @@ class GenericEnumSizesView final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBytes().Ok() && - backing_.SizeInBytes() >= - static_cast( - IntrinsicSizeInBytes().UncheckedRead()); + return IntrinsicSizeInBytes().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBytes().Ok() && + backing_.SizeInBytes() >= + static_cast( + IntrinsicSizeInBytes().UncheckedRead())); } static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); @@ -3738,6 +3769,9 @@ class GenericEnumSizesView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -3776,6 +3810,9 @@ class GenericEnumSizesView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -3814,6 +3851,9 @@ class GenericEnumSizesView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -3961,9 +4001,11 @@ class GenericEmbossReservedAnonymousField1View final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBits().Ok() && - backing_.SizeInBits() >= static_cast( - IntrinsicSizeInBits().UncheckedRead()); + return IntrinsicSizeInBits().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBits().Ok() && + backing_.SizeInBits() >= + static_cast( + IntrinsicSizeInBits().UncheckedRead())); } static constexpr ::std::size_t SizeInBits() { return static_cast(IntrinsicSizeInBits().Read()); @@ -4158,6 +4200,9 @@ class GenericEmbossReservedAnonymousField1View final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -4196,6 +4241,9 @@ class GenericEmbossReservedAnonymousField1View final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -4234,6 +4282,9 @@ class GenericEmbossReservedAnonymousField1View final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -4392,10 +4443,11 @@ class GenericExplicitlySizedEnumSizesView final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBytes().Ok() && - backing_.SizeInBytes() >= - static_cast( - IntrinsicSizeInBytes().UncheckedRead()); + return IntrinsicSizeInBytes().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBytes().Ok() && + backing_.SizeInBytes() >= + static_cast( + IntrinsicSizeInBytes().UncheckedRead())); } static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); @@ -4836,6 +4888,9 @@ class GenericExplicitlySizedEnumSizesView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -4874,6 +4929,9 @@ class GenericExplicitlySizedEnumSizesView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -4912,6 +4970,9 @@ class GenericExplicitlySizedEnumSizesView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -5399,10 +5460,11 @@ class GenericArraySizesView final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBytes().Ok() && - backing_.SizeInBytes() >= - static_cast( - IntrinsicSizeInBytes().UncheckedRead()); + return IntrinsicSizeInBytes().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBytes().Ok() && + backing_.SizeInBytes() >= + static_cast( + IntrinsicSizeInBytes().UncheckedRead())); } static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); @@ -6160,6 +6222,9 @@ class GenericArraySizesView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -6198,6 +6263,9 @@ class GenericArraySizesView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -6236,6 +6304,9 @@ class GenericArraySizesView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& diff --git a/testdata/golden_cpp/virtual_field.emb.h b/testdata/golden_cpp/virtual_field.emb.h index e78af9bf..b77ab36d 100644 --- a/testdata/golden_cpp/virtual_field.emb.h +++ b/testdata/golden_cpp/virtual_field.emb.h @@ -236,10 +236,11 @@ class GenericStructureWithConstantsView final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBytes().Ok() && - backing_.SizeInBytes() >= - static_cast( - IntrinsicSizeInBytes().UncheckedRead()); + return IntrinsicSizeInBytes().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBytes().Ok() && + backing_.SizeInBytes() >= + static_cast( + IntrinsicSizeInBytes().UncheckedRead())); } static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); @@ -626,6 +627,9 @@ class GenericStructureWithConstantsView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -663,6 +667,9 @@ class GenericStructureWithConstantsView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -700,6 +707,9 @@ class GenericStructureWithConstantsView final { static constexpr ::std::uint32_t Read(); static constexpr ::std::uint32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -737,6 +747,9 @@ class GenericStructureWithConstantsView final { static constexpr ::std::int64_t Read(); static constexpr ::std::int64_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -774,6 +787,9 @@ class GenericStructureWithConstantsView final { static constexpr ::std::int64_t Read(); static constexpr ::std::int64_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -839,6 +855,9 @@ class GenericStructureWithConstantsView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -876,6 +895,9 @@ class GenericStructureWithConstantsView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -914,6 +936,9 @@ class GenericStructureWithConstantsView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -952,6 +977,9 @@ class GenericStructureWithConstantsView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -990,6 +1018,9 @@ class GenericStructureWithConstantsView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -1153,10 +1184,11 @@ class GenericStructureWithComputedValuesView final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBytes().Ok() && - backing_.SizeInBytes() >= - static_cast( - IntrinsicSizeInBytes().UncheckedRead()); + return IntrinsicSizeInBytes().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBytes().Ok() && + backing_.SizeInBytes() >= + static_cast( + IntrinsicSizeInBytes().UncheckedRead())); } static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); @@ -1554,6 +1586,14 @@ class GenericStructureWithComputedValuesView final { return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); } + ::emboss::support::Maybe IsUndefined() const { + const auto emboss_reserved_local_value = MaybeRead(); + return emboss_reserved_local_value.Known() + ? ::emboss::support::Maybe(false) + : (emboss_reserved_local_value.IsUndefined() + ? ::emboss::support::Maybe(true) + : ::emboss::support::Maybe()); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -1629,6 +1669,14 @@ class GenericStructureWithComputedValuesView final { return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); } + ::emboss::support::Maybe IsUndefined() const { + const auto emboss_reserved_local_value = MaybeRead(); + return emboss_reserved_local_value.Known() + ? ::emboss::support::Maybe(false) + : (emboss_reserved_local_value.IsUndefined() + ? ::emboss::support::Maybe(true) + : ::emboss::support::Maybe()); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -1765,6 +1813,14 @@ class GenericStructureWithComputedValuesView final { return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); } + ::emboss::support::Maybe IsUndefined() const { + const auto emboss_reserved_local_value = MaybeRead(); + return emboss_reserved_local_value.Known() + ? ::emboss::support::Maybe(false) + : (emboss_reserved_local_value.IsUndefined() + ? ::emboss::support::Maybe(true) + : ::emboss::support::Maybe()); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -1840,6 +1896,14 @@ class GenericStructureWithComputedValuesView final { return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); } + ::emboss::support::Maybe IsUndefined() const { + const auto emboss_reserved_local_value = MaybeRead(); + return emboss_reserved_local_value.Known() + ? ::emboss::support::Maybe(false) + : (emboss_reserved_local_value.IsUndefined() + ? ::emboss::support::Maybe(true) + : ::emboss::support::Maybe()); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -1964,6 +2028,14 @@ class GenericStructureWithComputedValuesView final { return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); } + ::emboss::support::Maybe IsUndefined() const { + const auto emboss_reserved_local_value = MaybeRead(); + return emboss_reserved_local_value.Known() + ? ::emboss::support::Maybe(false) + : (emboss_reserved_local_value.IsUndefined() + ? ::emboss::support::Maybe(true) + : ::emboss::support::Maybe()); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -2028,6 +2100,9 @@ class GenericStructureWithComputedValuesView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -2066,6 +2141,9 @@ class GenericStructureWithComputedValuesView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -2104,6 +2182,9 @@ class GenericStructureWithComputedValuesView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -2255,10 +2336,11 @@ class GenericStructureWithConditionalValueView final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBytes().Ok() && - backing_.SizeInBytes() >= - static_cast( - IntrinsicSizeInBytes().UncheckedRead()); + return IntrinsicSizeInBytes().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBytes().Ok() && + backing_.SizeInBytes() >= + static_cast( + IntrinsicSizeInBytes().UncheckedRead())); } static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); @@ -2515,6 +2597,14 @@ class GenericStructureWithConditionalValueView final { return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); } + ::emboss::support::Maybe IsUndefined() const { + const auto emboss_reserved_local_value = MaybeRead(); + return emboss_reserved_local_value.Known() + ? ::emboss::support::Maybe(false) + : (emboss_reserved_local_value.IsUndefined() + ? ::emboss::support::Maybe(true) + : ::emboss::support::Maybe()); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -2590,6 +2680,14 @@ class GenericStructureWithConditionalValueView final { return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); } + ::emboss::support::Maybe IsUndefined() const { + const auto emboss_reserved_local_value = MaybeRead(); + return emboss_reserved_local_value.Known() + ? ::emboss::support::Maybe(false) + : (emboss_reserved_local_value.IsUndefined() + ? ::emboss::support::Maybe(true) + : ::emboss::support::Maybe()); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -2698,6 +2796,9 @@ class GenericStructureWithConditionalValueView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -2736,6 +2837,9 @@ class GenericStructureWithConditionalValueView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -2774,6 +2878,9 @@ class GenericStructureWithConditionalValueView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -2927,10 +3034,11 @@ class GenericStructureWithValueInConditionView final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBytes().Ok() && - backing_.SizeInBytes() >= - static_cast( - IntrinsicSizeInBytes().UncheckedRead()); + return IntrinsicSizeInBytes().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBytes().Ok() && + backing_.SizeInBytes() >= + static_cast( + IntrinsicSizeInBytes().UncheckedRead())); } ::std::size_t SizeInBytes() const { return static_cast(IntrinsicSizeInBytes().Read()); @@ -3218,6 +3326,14 @@ class GenericStructureWithValueInConditionView final { return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); } + ::emboss::support::Maybe IsUndefined() const { + const auto emboss_reserved_local_value = MaybeRead(); + return emboss_reserved_local_value.Known() + ? ::emboss::support::Maybe(false) + : (emboss_reserved_local_value.IsUndefined() + ? ::emboss::support::Maybe(true) + : ::emboss::support::Maybe()); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -3305,6 +3421,14 @@ class GenericStructureWithValueInConditionView final { return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); } + ::emboss::support::Maybe IsUndefined() const { + const auto emboss_reserved_local_value = MaybeRead(); + return emboss_reserved_local_value.Known() + ? ::emboss::support::Maybe(false) + : (emboss_reserved_local_value.IsUndefined() + ? ::emboss::support::Maybe(true) + : ::emboss::support::Maybe()); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -3382,6 +3506,9 @@ class GenericStructureWithValueInConditionView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -3420,6 +3547,9 @@ class GenericStructureWithValueInConditionView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -3576,10 +3706,11 @@ class GenericStructureWithValuesInLocationView final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBytes().Ok() && - backing_.SizeInBytes() >= - static_cast( - IntrinsicSizeInBytes().UncheckedRead()); + return IntrinsicSizeInBytes().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBytes().Ok() && + backing_.SizeInBytes() >= + static_cast( + IntrinsicSizeInBytes().UncheckedRead())); } ::std::size_t SizeInBytes() const { return static_cast(IntrinsicSizeInBytes().Read()); @@ -3929,6 +4060,14 @@ class GenericStructureWithValuesInLocationView final { return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); } + ::emboss::support::Maybe IsUndefined() const { + const auto emboss_reserved_local_value = MaybeRead(); + return emboss_reserved_local_value.Known() + ? ::emboss::support::Maybe(false) + : (emboss_reserved_local_value.IsUndefined() + ? ::emboss::support::Maybe(true) + : ::emboss::support::Maybe()); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -4028,6 +4167,14 @@ class GenericStructureWithValuesInLocationView final { return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); } + ::emboss::support::Maybe IsUndefined() const { + const auto emboss_reserved_local_value = MaybeRead(); + return emboss_reserved_local_value.Known() + ? ::emboss::support::Maybe(false) + : (emboss_reserved_local_value.IsUndefined() + ? ::emboss::support::Maybe(true) + : ::emboss::support::Maybe()); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -4117,6 +4264,9 @@ class GenericStructureWithValuesInLocationView final { static constexpr ::std::int64_t Read(); static constexpr ::std::int64_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -4155,6 +4305,9 @@ class GenericStructureWithValuesInLocationView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -4300,10 +4453,11 @@ class GenericStructureWithBoolValueView final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBytes().Ok() && - backing_.SizeInBytes() >= - static_cast( - IntrinsicSizeInBytes().UncheckedRead()); + return IntrinsicSizeInBytes().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBytes().Ok() && + backing_.SizeInBytes() >= + static_cast( + IntrinsicSizeInBytes().UncheckedRead())); } static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); @@ -4521,6 +4675,14 @@ class GenericStructureWithBoolValueView final { return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); } + ::emboss::support::Maybe IsUndefined() const { + const auto emboss_reserved_local_value = MaybeRead(); + return emboss_reserved_local_value.Known() + ? ::emboss::support::Maybe(false) + : (emboss_reserved_local_value.IsUndefined() + ? ::emboss::support::Maybe(true) + : ::emboss::support::Maybe()); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -4579,6 +4741,9 @@ class GenericStructureWithBoolValueView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -4617,6 +4782,9 @@ class GenericStructureWithBoolValueView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -4655,6 +4823,9 @@ class GenericStructureWithBoolValueView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -4894,10 +5065,11 @@ class GenericStructureWithEnumValueView final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBytes().Ok() && - backing_.SizeInBytes() >= - static_cast( - IntrinsicSizeInBytes().UncheckedRead()); + return IntrinsicSizeInBytes().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBytes().Ok() && + backing_.SizeInBytes() >= + static_cast( + IntrinsicSizeInBytes().UncheckedRead())); } static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); @@ -5116,6 +5288,14 @@ class GenericStructureWithEnumValueView final { return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); } + ::emboss::support::Maybe IsUndefined() const { + const auto emboss_reserved_local_value = MaybeRead(); + return emboss_reserved_local_value.Known() + ? ::emboss::support::Maybe(false) + : (emboss_reserved_local_value.IsUndefined() + ? ::emboss::support::Maybe(true) + : ::emboss::support::Maybe()); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -5192,6 +5372,9 @@ class GenericStructureWithEnumValueView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -5230,6 +5413,9 @@ class GenericStructureWithEnumValueView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -5268,6 +5454,9 @@ class GenericStructureWithEnumValueView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -5417,10 +5606,11 @@ class GenericStructureWithBitsWithValueView final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBytes().Ok() && - backing_.SizeInBytes() >= - static_cast( - IntrinsicSizeInBytes().UncheckedRead()); + return IntrinsicSizeInBytes().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBytes().Ok() && + backing_.SizeInBytes() >= + static_cast( + IntrinsicSizeInBytes().UncheckedRead())); } static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); @@ -5676,6 +5866,14 @@ class GenericStructureWithBitsWithValueView final { return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); } + ::emboss::support::Maybe IsUndefined() const { + const auto emboss_reserved_local_value = MaybeRead(); + return emboss_reserved_local_value.Known() + ? ::emboss::support::Maybe(false) + : (emboss_reserved_local_value.IsUndefined() + ? ::emboss::support::Maybe(true) + : ::emboss::support::Maybe()); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -5736,6 +5934,9 @@ class GenericStructureWithBitsWithValueView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -5774,6 +5975,9 @@ class GenericStructureWithBitsWithValueView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -5812,6 +6016,9 @@ class GenericStructureWithBitsWithValueView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -5956,9 +6163,11 @@ class GenericBitsWithValueView final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBits().Ok() && - backing_.SizeInBits() >= static_cast( - IntrinsicSizeInBits().UncheckedRead()); + return IntrinsicSizeInBits().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBits().Ok() && + backing_.SizeInBits() >= + static_cast( + IntrinsicSizeInBits().UncheckedRead())); } static constexpr ::std::size_t SizeInBits() { return static_cast(IntrinsicSizeInBits().Read()); @@ -6245,6 +6454,14 @@ class GenericBitsWithValueView final { return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); } + ::emboss::support::Maybe IsUndefined() const { + const auto emboss_reserved_local_value = MaybeRead(); + return emboss_reserved_local_value.Known() + ? ::emboss::support::Maybe(false) + : (emboss_reserved_local_value.IsUndefined() + ? ::emboss::support::Maybe(true) + : ::emboss::support::Maybe()); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -6309,6 +6526,9 @@ class GenericBitsWithValueView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -6347,6 +6567,9 @@ class GenericBitsWithValueView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -6385,6 +6608,9 @@ class GenericBitsWithValueView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -6532,10 +6758,11 @@ class GenericStructureUsingForeignConstantsView final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBytes().Ok() && - backing_.SizeInBytes() >= - static_cast( - IntrinsicSizeInBytes().UncheckedRead()); + return IntrinsicSizeInBytes().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBytes().Ok() && + backing_.SizeInBytes() >= + static_cast( + IntrinsicSizeInBytes().UncheckedRead())); } static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); @@ -6740,6 +6967,9 @@ class GenericStructureUsingForeignConstantsView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -6777,6 +7007,9 @@ class GenericStructureUsingForeignConstantsView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -6815,6 +7048,9 @@ class GenericStructureUsingForeignConstantsView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -6853,6 +7089,9 @@ class GenericStructureUsingForeignConstantsView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -6997,10 +7236,11 @@ class GenericHeaderView final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBytes().Ok() && - backing_.SizeInBytes() >= - static_cast( - IntrinsicSizeInBytes().UncheckedRead()); + return IntrinsicSizeInBytes().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBytes().Ok() && + backing_.SizeInBytes() >= + static_cast( + IntrinsicSizeInBytes().UncheckedRead())); } static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); @@ -7262,6 +7502,9 @@ class GenericHeaderView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -7300,6 +7543,9 @@ class GenericHeaderView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -7338,6 +7584,9 @@ class GenericHeaderView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -7479,10 +7728,11 @@ class GenericSubfieldOfAliasView final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBytes().Ok() && - backing_.SizeInBytes() >= - static_cast( - IntrinsicSizeInBytes().UncheckedRead()); + return IntrinsicSizeInBytes().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBytes().Ok() && + backing_.SizeInBytes() >= + static_cast( + IntrinsicSizeInBytes().UncheckedRead())); } static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); @@ -7750,6 +8000,9 @@ class GenericSubfieldOfAliasView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -7788,6 +8041,9 @@ class GenericSubfieldOfAliasView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -7826,6 +8082,9 @@ class GenericSubfieldOfAliasView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -7971,10 +8230,11 @@ class GenericRestrictedAliasView final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBytes().Ok() && - backing_.SizeInBytes() >= - static_cast( - IntrinsicSizeInBytes().UncheckedRead()); + return IntrinsicSizeInBytes().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBytes().Ok() && + backing_.SizeInBytes() >= + static_cast( + IntrinsicSizeInBytes().UncheckedRead())); } static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); @@ -8279,6 +8539,9 @@ class GenericRestrictedAliasView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -8317,6 +8580,9 @@ class GenericRestrictedAliasView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -8355,6 +8621,9 @@ class GenericRestrictedAliasView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -8496,10 +8765,11 @@ class GenericXView final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBytes().Ok() && - backing_.SizeInBytes() >= - static_cast( - IntrinsicSizeInBytes().UncheckedRead()); + return IntrinsicSizeInBytes().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBytes().Ok() && + backing_.SizeInBytes() >= + static_cast( + IntrinsicSizeInBytes().UncheckedRead())); } ::std::size_t SizeInBytes() const { return static_cast(IntrinsicSizeInBytes().Read()); @@ -8774,6 +9044,14 @@ class GenericXView final { return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); } + ::emboss::support::Maybe IsUndefined() const { + const auto emboss_reserved_local_value = MaybeRead(); + return emboss_reserved_local_value.Known() + ? ::emboss::support::Maybe(false) + : (emboss_reserved_local_value.IsUndefined() + ? ::emboss::support::Maybe(true) + : ::emboss::support::Maybe()); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -8851,6 +9129,9 @@ class GenericXView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -8889,6 +9170,9 @@ class GenericXView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -9030,10 +9314,11 @@ class GenericHasFieldView final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBytes().Ok() && - backing_.SizeInBytes() >= - static_cast( - IntrinsicSizeInBytes().UncheckedRead()); + return IntrinsicSizeInBytes().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBytes().Ok() && + backing_.SizeInBytes() >= + static_cast( + IntrinsicSizeInBytes().UncheckedRead())); } ::std::size_t SizeInBytes() const { return static_cast(IntrinsicSizeInBytes().Read()); @@ -9364,6 +9649,14 @@ class GenericHasFieldView final { return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); } + ::emboss::support::Maybe IsUndefined() const { + const auto emboss_reserved_local_value = MaybeRead(); + return emboss_reserved_local_value.Known() + ? ::emboss::support::Maybe(false) + : (emboss_reserved_local_value.IsUndefined() + ? ::emboss::support::Maybe(true) + : ::emboss::support::Maybe()); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -9425,6 +9718,14 @@ class GenericHasFieldView final { return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); } + ::emboss::support::Maybe IsUndefined() const { + const auto emboss_reserved_local_value = MaybeRead(); + return emboss_reserved_local_value.Known() + ? ::emboss::support::Maybe(false) + : (emboss_reserved_local_value.IsUndefined() + ? ::emboss::support::Maybe(true) + : ::emboss::support::Maybe()); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -9502,6 +9803,9 @@ class GenericHasFieldView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -9540,6 +9844,9 @@ class GenericHasFieldView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -9688,10 +9995,11 @@ class GenericVirtualUnconditionallyUsesConditionalView final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBytes().Ok() && - backing_.SizeInBytes() >= - static_cast( - IntrinsicSizeInBytes().UncheckedRead()); + return IntrinsicSizeInBytes().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBytes().Ok() && + backing_.SizeInBytes() >= + static_cast( + IntrinsicSizeInBytes().UncheckedRead())); } ::std::size_t SizeInBytes() const { return static_cast(IntrinsicSizeInBytes().Read()); @@ -9989,6 +10297,14 @@ class GenericVirtualUnconditionallyUsesConditionalView final { return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); } + ::emboss::support::Maybe IsUndefined() const { + const auto emboss_reserved_local_value = MaybeRead(); + return emboss_reserved_local_value.Known() + ? ::emboss::support::Maybe(false) + : (emboss_reserved_local_value.IsUndefined() + ? ::emboss::support::Maybe(true) + : ::emboss::support::Maybe()); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -10079,6 +10395,14 @@ class GenericVirtualUnconditionallyUsesConditionalView final { return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); } + ::emboss::support::Maybe IsUndefined() const { + const auto emboss_reserved_local_value = MaybeRead(); + return emboss_reserved_local_value.Known() + ? ::emboss::support::Maybe(false) + : (emboss_reserved_local_value.IsUndefined() + ? ::emboss::support::Maybe(true) + : ::emboss::support::Maybe()); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -10156,6 +10480,9 @@ class GenericVirtualUnconditionallyUsesConditionalView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -10194,6 +10521,9 @@ class GenericVirtualUnconditionallyUsesConditionalView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -10339,9 +10669,11 @@ class GenericRView final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBits().Ok() && - backing_.SizeInBits() >= static_cast( - IntrinsicSizeInBits().UncheckedRead()); + return IntrinsicSizeInBits().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBits().Ok() && + backing_.SizeInBits() >= + static_cast( + IntrinsicSizeInBits().UncheckedRead())); } static constexpr ::std::size_t SizeInBits() { return static_cast(IntrinsicSizeInBits().Read()); @@ -10540,6 +10872,9 @@ class GenericRView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -10593,6 +10928,14 @@ class GenericRView final { return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); } + ::emboss::support::Maybe IsUndefined() const { + const auto emboss_reserved_local_value = MaybeRead(); + return emboss_reserved_local_value.Known() + ? ::emboss::support::Maybe(false) + : (emboss_reserved_local_value.IsUndefined() + ? ::emboss::support::Maybe(true) + : ::emboss::support::Maybe()); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -10652,6 +10995,9 @@ class GenericRView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -10690,6 +11036,9 @@ class GenericRView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -10826,10 +11175,11 @@ class GenericUsesSizeView final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBytes().Ok() && - backing_.SizeInBytes() >= - static_cast( - IntrinsicSizeInBytes().UncheckedRead()); + return IntrinsicSizeInBytes().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBytes().Ok() && + backing_.SizeInBytes() >= + static_cast( + IntrinsicSizeInBytes().UncheckedRead())); } static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); @@ -11033,6 +11383,9 @@ class GenericUsesSizeView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -11086,6 +11439,14 @@ class GenericUsesSizeView final { return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); } + ::emboss::support::Maybe IsUndefined() const { + const auto emboss_reserved_local_value = MaybeRead(); + return emboss_reserved_local_value.Known() + ? ::emboss::support::Maybe(false) + : (emboss_reserved_local_value.IsUndefined() + ? ::emboss::support::Maybe(true) + : ::emboss::support::Maybe()); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -11145,6 +11506,9 @@ class GenericUsesSizeView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -11183,6 +11547,9 @@ class GenericUsesSizeView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -11322,10 +11689,11 @@ class GenericUsesExternalSizeView final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBytes().Ok() && - backing_.SizeInBytes() >= - static_cast( - IntrinsicSizeInBytes().UncheckedRead()); + return IntrinsicSizeInBytes().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBytes().Ok() && + backing_.SizeInBytes() >= + static_cast( + IntrinsicSizeInBytes().UncheckedRead())); } static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); @@ -11577,6 +11945,9 @@ class GenericUsesExternalSizeView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -11615,6 +11986,9 @@ class GenericUsesExternalSizeView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -11653,6 +12027,9 @@ class GenericUsesExternalSizeView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -11808,10 +12185,11 @@ class GenericImplicitWriteBackView final { } Storage BackingStorage() const { return backing_; } bool IsComplete() const { - return backing_.Ok() && IntrinsicSizeInBytes().Ok() && - backing_.SizeInBytes() >= - static_cast( - IntrinsicSizeInBytes().UncheckedRead()); + return IntrinsicSizeInBytes().IsUndefined().ValueOr(false) || + (backing_.Ok() && IntrinsicSizeInBytes().Ok() && + backing_.SizeInBytes() >= + static_cast( + IntrinsicSizeInBytes().UncheckedRead())); } static constexpr ::std::size_t SizeInBytes() { return static_cast(IntrinsicSizeInBytes().Read()); @@ -12200,6 +12578,14 @@ class GenericImplicitWriteBackView final { return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); } + ::emboss::support::Maybe IsUndefined() const { + const auto emboss_reserved_local_value = MaybeRead(); + return emboss_reserved_local_value.Known() + ? ::emboss::support::Maybe(false) + : (emboss_reserved_local_value.IsUndefined() + ? ::emboss::support::Maybe(true) + : ::emboss::support::Maybe()); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -12323,6 +12709,14 @@ class GenericImplicitWriteBackView final { return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); } + ::emboss::support::Maybe IsUndefined() const { + const auto emboss_reserved_local_value = MaybeRead(); + return emboss_reserved_local_value.Known() + ? ::emboss::support::Maybe(false) + : (emboss_reserved_local_value.IsUndefined() + ? ::emboss::support::Maybe(true) + : ::emboss::support::Maybe()); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -12446,6 +12840,14 @@ class GenericImplicitWriteBackView final { return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); } + ::emboss::support::Maybe IsUndefined() const { + const auto emboss_reserved_local_value = MaybeRead(); + return emboss_reserved_local_value.Known() + ? ::emboss::support::Maybe(false) + : (emboss_reserved_local_value.IsUndefined() + ? ::emboss::support::Maybe(true) + : ::emboss::support::Maybe()); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -12565,6 +12967,14 @@ class GenericImplicitWriteBackView final { return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); } + ::emboss::support::Maybe IsUndefined() const { + const auto emboss_reserved_local_value = MaybeRead(); + return emboss_reserved_local_value.Known() + ? ::emboss::support::Maybe(false) + : (emboss_reserved_local_value.IsUndefined() + ? ::emboss::support::Maybe(true) + : ::emboss::support::Maybe()); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -12688,6 +13098,14 @@ class GenericImplicitWriteBackView final { return emboss_reserved_local_value.Known() && ValueIsOk(emboss_reserved_local_value.ValueOrDefault()); } + ::emboss::support::Maybe IsUndefined() const { + const auto emboss_reserved_local_value = MaybeRead(); + return emboss_reserved_local_value.Known() + ? ::emboss::support::Maybe(false) + : (emboss_reserved_local_value.IsUndefined() + ? ::emboss::support::Maybe(true) + : ::emboss::support::Maybe()); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -12815,6 +13233,9 @@ class GenericImplicitWriteBackView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -12853,6 +13274,9 @@ class GenericImplicitWriteBackView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions& @@ -12891,6 +13315,9 @@ class GenericImplicitWriteBackView final { static constexpr ::std::int32_t Read(); static constexpr ::std::int32_t UncheckedRead(); static constexpr bool Ok() { return true; } + static constexpr ::emboss::support::Maybe IsUndefined() { + return ::emboss::support::Maybe(false); + } template void WriteToTextStream(Stream* emboss_reserved_local_stream, const ::emboss::TextOutputOptions&