From 025fd7289cbe3493f1c2747c1536ba29e46f3dea Mon Sep 17 00:00:00 2001 From: Miki Rozloznik Date: Thu, 1 Aug 2024 13:51:19 +0200 Subject: [PATCH] Extend runtime tests to support withbitPositionCode option --- .../cpp/runtime/src/zserio/IReflectable.h | 13 +++-- .../cpp/runtime/src/zserio/Reflectable.h | 3 +- .../polymorphic_allocator/ArrayBitmask.cpp | 2 +- .../polymorphic_allocator/ArrayBitmask.h | 2 +- .../polymorphic_allocator/ArrayEnum.cpp | 2 +- .../polymorphic_allocator/ArrayEnum.h | 2 +- .../polymorphic_allocator/ArrayHolder.cpp | 24 +++++++- .../polymorphic_allocator/ArrayHolder.h | 5 +- .../polymorphic_allocator/ArrayObject.cpp | 21 ++++++- .../polymorphic_allocator/ArrayObject.h | 5 +- .../ArrayParamObject.cpp | 30 +++++++++- .../polymorphic_allocator/ArrayParamObject.h | 5 +- .../polymorphic_allocator/CreatorBitmask.cpp | 2 +- .../polymorphic_allocator/CreatorBitmask.h | 2 +- .../polymorphic_allocator/CreatorEnum.cpp | 2 +- .../polymorphic_allocator/CreatorEnum.h | 2 +- .../polymorphic_allocator/CreatorNested.cpp | 29 +++++++++- .../polymorphic_allocator/CreatorNested.h | 5 +- .../polymorphic_allocator/CreatorObject.cpp | 58 +++++++++++++------ .../polymorphic_allocator/CreatorObject.h | 5 +- .../CreatorUnsignedEnum.cpp | 2 +- .../CreatorUnsignedEnum.h | 2 +- .../DebugStringObject.cpp | 20 ++++++- .../polymorphic_allocator/DebugStringObject.h | 5 +- .../DebugStringParamObject.cpp | 29 +++++++++- .../DebugStringParamObject.h | 5 +- .../ReflectableBitmask.cpp | 2 +- .../ReflectableBitmask.h | 2 +- .../polymorphic_allocator/ReflectableEnum.cpp | 2 +- .../polymorphic_allocator/ReflectableEnum.h | 2 +- .../ReflectableNested.cpp | 29 +++++++++- .../polymorphic_allocator/ReflectableNested.h | 5 +- .../ReflectableObject.cpp | 24 +++++++- .../polymorphic_allocator/ReflectableObject.h | 5 +- .../ReflectableUtilBitmask.cpp | 2 +- .../ReflectableUtilBitmask.h | 2 +- .../ReflectableUtilChoice.cpp | 30 +++++++++- .../ReflectableUtilChoice.h | 5 +- .../ReflectableUtilEnum.cpp | 2 +- .../ReflectableUtilEnum.h | 2 +- .../ReflectableUtilObject.cpp | 24 +++++++- .../ReflectableUtilObject.h | 5 +- .../ReflectableUtilUnion.cpp | 20 ++++++- .../ReflectableUtilUnion.h | 5 +- .../polymorphic_allocator/SerializeEnum.cpp | 2 +- .../polymorphic_allocator/SerializeEnum.h | 2 +- .../polymorphic_allocator/SerializeNested.cpp | 29 +++++++++- .../polymorphic_allocator/SerializeNested.h | 5 +- .../polymorphic_allocator/SerializeObject.cpp | 24 +++++++- .../polymorphic_allocator/SerializeObject.h | 5 +- .../polymorphic_allocator/WalkerBitmask.cpp | 2 +- .../polymorphic_allocator/WalkerBitmask.h | 2 +- .../polymorphic_allocator/WalkerChoice.cpp | 30 +++++++++- .../polymorphic_allocator/WalkerChoice.h | 5 +- .../polymorphic_allocator/WalkerNested.cpp | 20 ++++++- .../polymorphic_allocator/WalkerNested.h | 5 +- .../polymorphic_allocator/WalkerObject.cpp | 32 ++++++++-- .../polymorphic_allocator/WalkerObject.h | 5 +- .../polymorphic_allocator/WalkerUnion.cpp | 20 ++++++- .../polymorphic_allocator/WalkerUnion.h | 5 +- .../std_allocator/ArrayBitmask.cpp | 2 +- .../test_object/std_allocator/ArrayBitmask.h | 2 +- .../test_object/std_allocator/ArrayEnum.cpp | 2 +- .../test_object/std_allocator/ArrayEnum.h | 2 +- .../test_object/std_allocator/ArrayHolder.cpp | 24 +++++++- .../test_object/std_allocator/ArrayHolder.h | 5 +- .../test_object/std_allocator/ArrayObject.cpp | 21 ++++++- .../test_object/std_allocator/ArrayObject.h | 5 +- .../std_allocator/ArrayParamObject.cpp | 30 +++++++++- .../std_allocator/ArrayParamObject.h | 5 +- .../std_allocator/CreatorBitmask.cpp | 2 +- .../std_allocator/CreatorBitmask.h | 2 +- .../test_object/std_allocator/CreatorEnum.cpp | 2 +- .../test_object/std_allocator/CreatorEnum.h | 2 +- .../std_allocator/CreatorNested.cpp | 29 +++++++++- .../test_object/std_allocator/CreatorNested.h | 5 +- .../std_allocator/CreatorObject.cpp | 58 +++++++++++++------ .../test_object/std_allocator/CreatorObject.h | 5 +- .../std_allocator/CreatorUnsignedEnum.cpp | 2 +- .../std_allocator/CreatorUnsignedEnum.h | 2 +- .../std_allocator/DebugStringObject.cpp | 20 ++++++- .../std_allocator/DebugStringObject.h | 5 +- .../std_allocator/DebugStringParamObject.cpp | 29 +++++++++- .../std_allocator/DebugStringParamObject.h | 5 +- .../std_allocator/ReflectableBitmask.cpp | 2 +- .../std_allocator/ReflectableBitmask.h | 2 +- .../std_allocator/ReflectableEnum.cpp | 2 +- .../std_allocator/ReflectableEnum.h | 2 +- .../std_allocator/ReflectableNested.cpp | 29 +++++++++- .../std_allocator/ReflectableNested.h | 5 +- .../std_allocator/ReflectableObject.cpp | 24 +++++++- .../std_allocator/ReflectableObject.h | 5 +- .../std_allocator/ReflectableUtilBitmask.cpp | 2 +- .../std_allocator/ReflectableUtilBitmask.h | 2 +- .../std_allocator/ReflectableUtilChoice.cpp | 30 +++++++++- .../std_allocator/ReflectableUtilChoice.h | 5 +- .../std_allocator/ReflectableUtilEnum.cpp | 2 +- .../std_allocator/ReflectableUtilEnum.h | 2 +- .../std_allocator/ReflectableUtilObject.cpp | 24 +++++++- .../std_allocator/ReflectableUtilObject.h | 5 +- .../std_allocator/ReflectableUtilUnion.cpp | 20 ++++++- .../std_allocator/ReflectableUtilUnion.h | 5 +- .../std_allocator/SerializeEnum.cpp | 2 +- .../test_object/std_allocator/SerializeEnum.h | 2 +- .../std_allocator/SerializeNested.cpp | 29 +++++++++- .../std_allocator/SerializeNested.h | 5 +- .../std_allocator/SerializeObject.cpp | 24 +++++++- .../std_allocator/SerializeObject.h | 5 +- .../std_allocator/WalkerBitmask.cpp | 2 +- .../test_object/std_allocator/WalkerBitmask.h | 2 +- .../std_allocator/WalkerChoice.cpp | 30 +++++++++- .../test_object/std_allocator/WalkerChoice.h | 5 +- .../std_allocator/WalkerNested.cpp | 20 ++++++- .../test_object/std_allocator/WalkerNested.h | 5 +- .../std_allocator/WalkerObject.cpp | 32 ++++++++-- .../test_object/std_allocator/WalkerObject.h | 5 +- .../test_object/std_allocator/WalkerUnion.cpp | 20 ++++++- .../test_object/std_allocator/WalkerUnion.h | 5 +- .../runtime/test/test_object/test_object.zs | 4 +- .../runtime/test/zserio/ReflectableTest.cpp | 5 ++ scripts/update_test_objects.sh | 2 +- 121 files changed, 1110 insertions(+), 171 deletions(-) diff --git a/compiler/extensions/cpp/runtime/src/zserio/IReflectable.h b/compiler/extensions/cpp/runtime/src/zserio/IReflectable.h index 46725b10d..3b9fe9f52 100644 --- a/compiler/extensions/cpp/runtime/src/zserio/IReflectable.h +++ b/compiler/extensions/cpp/runtime/src/zserio/IReflectable.h @@ -510,13 +510,16 @@ class IBasicReflectable /** \} */ /** - * Returns the reflectables bit position (blob) in bits. + * Returns the bit position in the parsed blob after reading of the reflectable object. * - * \note The bit position is only stored for code generated using zserios `-withBitPositionCode` - * option and only set for objects read from a blob. + * This feature is experimental and can be removed without any warning! * - * \return The blob offset of the objects in bits - * \throw CppRuntimeException If the object was compiled without the source region feature enabled. + * \note Note that the returned bit position can be invalid if the Zserio object has been changed after + * reading (e.g. if some field has been set). + * \note The bit position is only stored for code generated using `-withBitPositionCode` option. + * + * \return The blob offset of the objects in bits. + * \throw CppRuntimeException If the object was compiled without the bit position feature enabled. */ virtual size_t bitPosition() const = 0; }; diff --git a/compiler/extensions/cpp/runtime/src/zserio/Reflectable.h b/compiler/extensions/cpp/runtime/src/zserio/Reflectable.h index 780cf8f9a..456ce2620 100644 --- a/compiler/extensions/cpp/runtime/src/zserio/Reflectable.h +++ b/compiler/extensions/cpp/runtime/src/zserio/Reflectable.h @@ -4378,7 +4378,8 @@ string ReflectableBase::toString() const template size_t ReflectableBase::bitPosition() const { - throw CppRuntimeException("Bit position unavailable for type '") << getTypeInfo().getSchemaName() << "'!"; + throw CppRuntimeException("Bit position is not available for type '") + << getTypeInfo().getSchemaName() << "'!"; } template diff --git a/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/ArrayBitmask.cpp b/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/ArrayBitmask.cpp index 413976030..64fb110b2 100644 --- a/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/ArrayBitmask.cpp +++ b/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/ArrayBitmask.cpp @@ -1,6 +1,6 @@ /** * Automatically generated by Zserio C++ generator version 1.0.2 using Zserio core 2.14.1. - * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, polymorphicAllocator. + * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, bitPosition, polymorphicAllocator. */ #include diff --git a/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/ArrayBitmask.h b/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/ArrayBitmask.h index 9a38d4cd4..bb8a5ea54 100644 --- a/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/ArrayBitmask.h +++ b/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/ArrayBitmask.h @@ -1,6 +1,6 @@ /** * Automatically generated by Zserio C++ generator version 1.0.2 using Zserio core 2.14.1. - * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, polymorphicAllocator. + * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, bitPosition, polymorphicAllocator. */ #ifndef TEST_OBJECT_POLYMORPHIC_ALLOCATOR_ARRAY_BITMASK_H diff --git a/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/ArrayEnum.cpp b/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/ArrayEnum.cpp index 0bf5e04e6..db1042212 100644 --- a/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/ArrayEnum.cpp +++ b/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/ArrayEnum.cpp @@ -1,6 +1,6 @@ /** * Automatically generated by Zserio C++ generator version 1.0.2 using Zserio core 2.14.1. - * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, polymorphicAllocator. + * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, bitPosition, polymorphicAllocator. */ #include diff --git a/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/ArrayEnum.h b/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/ArrayEnum.h index fac0dcd30..a26c04972 100644 --- a/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/ArrayEnum.h +++ b/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/ArrayEnum.h @@ -1,6 +1,6 @@ /** * Automatically generated by Zserio C++ generator version 1.0.2 using Zserio core 2.14.1. - * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, polymorphicAllocator. + * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, bitPosition, polymorphicAllocator. */ #ifndef TEST_OBJECT_POLYMORPHIC_ALLOCATOR_ARRAY_ENUM_H diff --git a/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/ArrayHolder.cpp b/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/ArrayHolder.cpp index 9589bc573..be4e6fb8c 100644 --- a/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/ArrayHolder.cpp +++ b/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/ArrayHolder.cpp @@ -1,6 +1,6 @@ /** * Automatically generated by Zserio C++ generator version 1.0.2 using Zserio core 2.14.1. - * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, polymorphicAllocator. + * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, bitPosition, polymorphicAllocator. */ #include @@ -22,6 +22,7 @@ namespace polymorphic_allocator ArrayHolder::ArrayHolder(const allocator_type& allocator) noexcept : m_areChildrenInitialized(false), + m_bitPosition(0), m_enumArray_(allocator), m_bitmaskArray_(allocator), m_packedArray_(allocator), @@ -31,6 +32,7 @@ ArrayHolder::ArrayHolder(const allocator_type& allocator) noexcept : ArrayHolder::ArrayHolder(::zserio::BitStreamReader& in, const allocator_type& allocator) : m_areChildrenInitialized(true), + m_bitPosition(in.getBitPosition()), m_enumArray_(readEnumArray(in, allocator)), m_bitmaskArray_(readBitmaskArray(in, allocator)), m_packedArray_(readPackedArray(in, allocator)), @@ -39,6 +41,7 @@ ArrayHolder::ArrayHolder(::zserio::BitStreamReader& in, const allocator_type& al } ArrayHolder::ArrayHolder(const ArrayHolder& other) : + m_bitPosition(other.m_bitPosition), m_enumArray_(other.m_enumArray_), m_bitmaskArray_(other.m_bitmaskArray_), m_packedArray_(other.m_packedArray_), @@ -56,6 +59,7 @@ ArrayHolder::ArrayHolder(const ArrayHolder& other) : ArrayHolder& ArrayHolder::operator=(const ArrayHolder& other) { + m_bitPosition = other.m_bitPosition; m_enumArray_ = other.m_enumArray_; m_bitmaskArray_ = other.m_bitmaskArray_; m_packedArray_ = other.m_packedArray_; @@ -73,6 +77,7 @@ ArrayHolder& ArrayHolder::operator=(const ArrayHolder& other) } ArrayHolder::ArrayHolder(ArrayHolder&& other) : + m_bitPosition(other.m_bitPosition), m_enumArray_(::std::move(other.m_enumArray_)), m_bitmaskArray_(::std::move(other.m_bitmaskArray_)), m_packedArray_(::std::move(other.m_packedArray_)), @@ -90,6 +95,7 @@ ArrayHolder::ArrayHolder(ArrayHolder&& other) : ArrayHolder& ArrayHolder::operator=(ArrayHolder&& other) { + m_bitPosition = other.m_bitPosition; m_enumArray_ = ::std::move(other.m_enumArray_); m_bitmaskArray_ = ::std::move(other.m_bitmaskArray_); m_packedArray_ = ::std::move(other.m_packedArray_); @@ -108,6 +114,7 @@ ArrayHolder& ArrayHolder::operator=(ArrayHolder&& other) ArrayHolder::ArrayHolder(::zserio::PropagateAllocatorT, const ArrayHolder& other, const allocator_type& allocator) : + m_bitPosition(other.m_bitPosition), m_enumArray_(::zserio::allocatorPropagatingCopy(other.m_enumArray_, allocator)), m_bitmaskArray_(::zserio::allocatorPropagatingCopy(other.m_bitmaskArray_, allocator)), m_packedArray_(::zserio::allocatorPropagatingCopy(other.m_packedArray_, allocator)), @@ -266,6 +273,11 @@ ::zserio::pmr::IReflectableConstPtr ArrayHolder::reflectable(const allocator_typ return ::zserio::pmr::AnyHolder(::std::cref(m_object), alloc); } + size_t bitPosition() const override + { + return m_object.bitPosition(); + } + private: const ::test_object::polymorphic_allocator::ArrayHolder& m_object; }; @@ -406,6 +418,11 @@ ::zserio::pmr::IReflectablePtr ArrayHolder::reflectable(const allocator_type& al return ::zserio::pmr::AnyHolder(::std::ref(m_object), alloc); } + size_t bitPosition() const override + { + return m_object.bitPosition(); + } + private: ::test_object::polymorphic_allocator::ArrayHolder& m_object; }; @@ -599,6 +616,11 @@ void ArrayHolder::write(::zserio::BitStreamWriter& out) const m_packedParamArray_.writePacked(*this, out); } +size_t ArrayHolder::bitPosition() const +{ + return m_bitPosition; +} + void ArrayHolder::ZserioElementFactory_packedArray::create(ArrayHolder&, ::zserio::pmr::vector<::test_object::polymorphic_allocator::ArrayObject>& array, ::zserio::BitStreamReader& in, size_t) diff --git a/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/ArrayHolder.h b/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/ArrayHolder.h index 55faaa7e0..c3f1c28bb 100644 --- a/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/ArrayHolder.h +++ b/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/ArrayHolder.h @@ -1,6 +1,6 @@ /** * Automatically generated by Zserio C++ generator version 1.0.2 using Zserio core 2.14.1. - * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, polymorphicAllocator. + * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, bitPosition, polymorphicAllocator. */ #ifndef TEST_OBJECT_POLYMORPHIC_ALLOCATOR_ARRAY_HOLDER_H @@ -108,6 +108,8 @@ class ArrayHolder void write(::zserio::BitStreamWriter& out) const; + size_t bitPosition() const; + private: class ZserioElementFactory_packedArray { @@ -163,6 +165,7 @@ class ArrayHolder const allocator_type& allocator); bool m_areChildrenInitialized; + size_t m_bitPosition; ZserioArrayType_enumArray m_enumArray_; ZserioArrayType_bitmaskArray m_bitmaskArray_; ZserioArrayType_packedArray m_packedArray_; diff --git a/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/ArrayObject.cpp b/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/ArrayObject.cpp index 13ade8fde..3f38220eb 100644 --- a/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/ArrayObject.cpp +++ b/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/ArrayObject.cpp @@ -1,6 +1,6 @@ /** * Automatically generated by Zserio C++ generator version 1.0.2 using Zserio core 2.14.1. - * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, polymorphicAllocator. + * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, bitPosition, polymorphicAllocator. */ #include @@ -21,22 +21,26 @@ namespace polymorphic_allocator { ArrayObject::ArrayObject(const allocator_type&) noexcept : + m_bitPosition(0), m_value_(uint32_t()) { } ArrayObject::ArrayObject(::zserio::BitStreamReader& in, const allocator_type&) : + m_bitPosition(in.getBitPosition()), m_value_(readValue(in)) { } ArrayObject::ArrayObject(ArrayObject::ZserioPackingContext& context, ::zserio::BitStreamReader& in, const allocator_type&) : + m_bitPosition(in.getBitPosition()), m_value_(readValue(context, in)) { } ArrayObject::ArrayObject(::zserio::PropagateAllocatorT, const ArrayObject& other, const allocator_type& allocator) : + m_bitPosition(other.m_bitPosition), m_value_(::zserio::allocatorPropagatingCopy(other.m_value_, allocator)) { } @@ -121,6 +125,11 @@ ::zserio::pmr::IReflectableConstPtr ArrayObject::reflectable(const allocator_typ return ::zserio::pmr::AnyHolder(::std::cref(m_object), alloc); } + size_t bitPosition() const override + { + return m_object.bitPosition(); + } + private: const ::test_object::polymorphic_allocator::ArrayObject& m_object; }; @@ -206,6 +215,11 @@ ::zserio::pmr::IReflectablePtr ArrayObject::reflectable(const allocator_type& al return ::zserio::pmr::AnyHolder(::std::ref(m_object), alloc); } + size_t bitPosition() const override + { + return m_object.bitPosition(); + } + private: ::test_object::polymorphic_allocator::ArrayObject& m_object; }; @@ -308,6 +322,11 @@ void ArrayObject::write(ArrayObject::ZserioPackingContext& context, ::zserio::Bi context.getValue().write<::zserio::BitFieldArrayTraits>(out, m_value_); } +size_t ArrayObject::bitPosition() const +{ + return m_bitPosition; +} + uint32_t ArrayObject::readValue(::zserio::BitStreamReader& in) { return static_cast(in.readBits(UINT8_C(31))); diff --git a/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/ArrayObject.h b/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/ArrayObject.h index 76149c4df..890e0ccd6 100644 --- a/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/ArrayObject.h +++ b/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/ArrayObject.h @@ -1,6 +1,6 @@ /** * Automatically generated by Zserio C++ generator version 1.0.2 using Zserio core 2.14.1. - * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, polymorphicAllocator. + * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, bitPosition, polymorphicAllocator. */ #ifndef TEST_OBJECT_POLYMORPHIC_ALLOCATOR_ARRAY_OBJECT_H @@ -92,11 +92,14 @@ class ArrayObject void write(::zserio::BitStreamWriter& out) const; void write(ZserioPackingContext& context, ::zserio::BitStreamWriter& out) const; + size_t bitPosition() const; + private: uint32_t readValue(::zserio::BitStreamReader& in); uint32_t readValue(ZserioPackingContext& context, ::zserio::BitStreamReader& in); + size_t m_bitPosition; uint32_t m_value_; }; diff --git a/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/ArrayParamObject.cpp b/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/ArrayParamObject.cpp index 3743c65fb..244781e79 100644 --- a/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/ArrayParamObject.cpp +++ b/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/ArrayParamObject.cpp @@ -1,6 +1,6 @@ /** * Automatically generated by Zserio C++ generator version 1.0.2 using Zserio core 2.14.1. - * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, polymorphicAllocator. + * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, bitPosition, polymorphicAllocator. */ #include @@ -24,6 +24,7 @@ namespace polymorphic_allocator ArrayParamObject::ArrayParamObject(const allocator_type&) noexcept : m_isInitialized(false), + m_bitPosition(0), m_value_(uint32_t()) { } @@ -32,6 +33,7 @@ ArrayParamObject::ArrayParamObject(::zserio::BitStreamReader& in, ::test_object::polymorphic_allocator::ArrayObject& param_, const allocator_type&) : m_param_(¶m_), m_isInitialized(true), + m_bitPosition(in.getBitPosition()), m_value_(readValue(in)) { } @@ -40,11 +42,13 @@ ArrayParamObject::ArrayParamObject(ArrayParamObject::ZserioPackingContext& conte ::test_object::polymorphic_allocator::ArrayObject& param_, const allocator_type&) : m_param_(¶m_), m_isInitialized(true), + m_bitPosition(in.getBitPosition()), m_value_(readValue(context, in)) { } ArrayParamObject::ArrayParamObject(const ArrayParamObject& other) : + m_bitPosition(other.m_bitPosition), m_value_(other.m_value_) { if (other.m_isInitialized) @@ -59,6 +63,7 @@ ArrayParamObject::ArrayParamObject(const ArrayParamObject& other) : ArrayParamObject& ArrayParamObject::operator=(const ArrayParamObject& other) { + m_bitPosition = other.m_bitPosition; m_value_ = other.m_value_; if (other.m_isInitialized) { @@ -73,6 +78,7 @@ ArrayParamObject& ArrayParamObject::operator=(const ArrayParamObject& other) } ArrayParamObject::ArrayParamObject(ArrayParamObject&& other) : + m_bitPosition(other.m_bitPosition), m_value_(::std::move(other.m_value_)) { if (other.m_isInitialized) @@ -87,6 +93,7 @@ ArrayParamObject::ArrayParamObject(ArrayParamObject&& other) : ArrayParamObject& ArrayParamObject::operator=(ArrayParamObject&& other) { + m_bitPosition = other.m_bitPosition; m_value_ = ::std::move(other.m_value_); if (other.m_isInitialized) { @@ -103,6 +110,7 @@ ArrayParamObject& ArrayParamObject::operator=(ArrayParamObject&& other) ArrayParamObject::ArrayParamObject(::zserio::NoInitT, const ArrayParamObject& other) : m_isInitialized(false), + m_bitPosition(other.m_bitPosition), m_value_(other.m_value_) { } @@ -111,6 +119,7 @@ ArrayParamObject& ArrayParamObject::assign(::zserio::NoInitT, const ArrayParamObject& other) { m_isInitialized = false; + m_bitPosition = other.m_bitPosition; m_value_ = other.m_value_; return *this; @@ -119,6 +128,7 @@ ArrayParamObject& ArrayParamObject::assign(::zserio::NoInitT, ArrayParamObject::ArrayParamObject(::zserio::NoInitT, ArrayParamObject&& other) : m_isInitialized(false), + m_bitPosition(other.m_bitPosition), m_value_(::std::move(other.m_value_)) { } @@ -127,6 +137,7 @@ ArrayParamObject& ArrayParamObject::assign(::zserio::NoInitT, ArrayParamObject&& other) { m_isInitialized = false; + m_bitPosition = other.m_bitPosition; m_value_ = ::std::move(other.m_value_); return *this; @@ -134,6 +145,7 @@ ArrayParamObject& ArrayParamObject::assign(::zserio::NoInitT, ArrayParamObject::ArrayParamObject(::zserio::PropagateAllocatorT, const ArrayParamObject& other, const allocator_type& allocator) : + m_bitPosition(other.m_bitPosition), m_value_(::zserio::allocatorPropagatingCopy(other.m_value_, allocator)) { if (other.m_isInitialized) @@ -149,6 +161,7 @@ ArrayParamObject::ArrayParamObject(::zserio::PropagateAllocatorT, ArrayParamObject::ArrayParamObject(::zserio::PropagateAllocatorT, ::zserio::NoInitT, const ArrayParamObject& other, const allocator_type& allocator) : m_isInitialized(false), + m_bitPosition(other.m_bitPosition), m_value_(::zserio::allocatorPropagatingCopy(other.m_value_, allocator)) { } @@ -247,6 +260,11 @@ ::zserio::pmr::IReflectableConstPtr ArrayParamObject::reflectable(const allocato return ::zserio::pmr::AnyHolder(::std::cref(m_object), alloc); } + size_t bitPosition() const override + { + return m_object.bitPosition(); + } + private: const ::test_object::polymorphic_allocator::ArrayParamObject& m_object; }; @@ -364,6 +382,11 @@ ::zserio::pmr::IReflectablePtr ArrayParamObject::reflectable(const allocator_typ return ::zserio::pmr::AnyHolder(::std::ref(m_object), alloc); } + size_t bitPosition() const override + { + return m_object.bitPosition(); + } + private: ::test_object::polymorphic_allocator::ArrayParamObject& m_object; }; @@ -519,6 +542,11 @@ void ArrayParamObject::write(ArrayParamObject::ZserioPackingContext& context, :: context.getValue().write<::zserio::StdIntArrayTraits>(out, m_value_); } +size_t ArrayParamObject::bitPosition() const +{ + return m_bitPosition; +} + uint32_t ArrayParamObject::readValue(::zserio::BitStreamReader& in) { uint32_t readField = static_cast(in.readBits(UINT8_C(32))); diff --git a/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/ArrayParamObject.h b/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/ArrayParamObject.h index a9f9c4a10..f9ab64472 100644 --- a/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/ArrayParamObject.h +++ b/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/ArrayParamObject.h @@ -1,6 +1,6 @@ /** * Automatically generated by Zserio C++ generator version 1.0.2 using Zserio core 2.14.1. - * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, polymorphicAllocator. + * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, bitPosition, polymorphicAllocator. */ #ifndef TEST_OBJECT_POLYMORPHIC_ALLOCATOR_ARRAY_PARAM_OBJECT_H @@ -114,6 +114,8 @@ class ArrayParamObject void write(::zserio::BitStreamWriter& out) const; void write(ZserioPackingContext& context, ::zserio::BitStreamWriter& out) const; + size_t bitPosition() const; + private: uint32_t readValue(::zserio::BitStreamReader& in); uint32_t readValue(ZserioPackingContext& context, @@ -121,6 +123,7 @@ class ArrayParamObject ::test_object::polymorphic_allocator::ArrayObject* m_param_; bool m_isInitialized; + size_t m_bitPosition; uint32_t m_value_; }; diff --git a/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/CreatorBitmask.cpp b/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/CreatorBitmask.cpp index bb4e4a33b..a5b27492a 100644 --- a/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/CreatorBitmask.cpp +++ b/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/CreatorBitmask.cpp @@ -1,6 +1,6 @@ /** * Automatically generated by Zserio C++ generator version 1.0.2 using Zserio core 2.14.1. - * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, polymorphicAllocator. + * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, bitPosition, polymorphicAllocator. */ #include diff --git a/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/CreatorBitmask.h b/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/CreatorBitmask.h index 60f7905d0..e863e2526 100644 --- a/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/CreatorBitmask.h +++ b/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/CreatorBitmask.h @@ -1,6 +1,6 @@ /** * Automatically generated by Zserio C++ generator version 1.0.2 using Zserio core 2.14.1. - * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, polymorphicAllocator. + * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, bitPosition, polymorphicAllocator. */ #ifndef TEST_OBJECT_POLYMORPHIC_ALLOCATOR_CREATOR_BITMASK_H diff --git a/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/CreatorEnum.cpp b/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/CreatorEnum.cpp index 36b43642d..9bb168cc4 100644 --- a/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/CreatorEnum.cpp +++ b/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/CreatorEnum.cpp @@ -1,6 +1,6 @@ /** * Automatically generated by Zserio C++ generator version 1.0.2 using Zserio core 2.14.1. - * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, polymorphicAllocator. + * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, bitPosition, polymorphicAllocator. */ #include diff --git a/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/CreatorEnum.h b/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/CreatorEnum.h index f8d805903..653decc17 100644 --- a/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/CreatorEnum.h +++ b/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/CreatorEnum.h @@ -1,6 +1,6 @@ /** * Automatically generated by Zserio C++ generator version 1.0.2 using Zserio core 2.14.1. - * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, polymorphicAllocator. + * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, bitPosition, polymorphicAllocator. */ #ifndef TEST_OBJECT_POLYMORPHIC_ALLOCATOR_CREATOR_ENUM_H diff --git a/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/CreatorNested.cpp b/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/CreatorNested.cpp index fe76ca881..decb60842 100644 --- a/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/CreatorNested.cpp +++ b/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/CreatorNested.cpp @@ -1,6 +1,6 @@ /** * Automatically generated by Zserio C++ generator version 1.0.2 using Zserio core 2.14.1. - * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, polymorphicAllocator. + * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, bitPosition, polymorphicAllocator. */ #include @@ -22,6 +22,7 @@ namespace polymorphic_allocator CreatorNested::CreatorNested(const allocator_type& allocator) noexcept : m_isInitialized(false), + m_bitPosition(0), m_value_(uint32_t()), m_text_(allocator), m_externData_(allocator), @@ -35,6 +36,7 @@ CreatorNested::CreatorNested(::zserio::BitStreamReader& in, uint32_t param_, const allocator_type& allocator) : m_param_(param_), m_isInitialized(true), + m_bitPosition(in.getBitPosition()), m_value_(readValue(in)), m_text_(readText(in, allocator)), m_externData_(readExternData(in, allocator)), @@ -45,6 +47,7 @@ CreatorNested::CreatorNested(::zserio::BitStreamReader& in, } CreatorNested::CreatorNested(const CreatorNested& other) : + m_bitPosition(other.m_bitPosition), m_value_(other.m_value_), m_text_(other.m_text_), m_externData_(other.m_externData_), @@ -64,6 +67,7 @@ CreatorNested::CreatorNested(const CreatorNested& other) : CreatorNested& CreatorNested::operator=(const CreatorNested& other) { + m_bitPosition = other.m_bitPosition; m_value_ = other.m_value_; m_text_ = other.m_text_; m_externData_ = other.m_externData_; @@ -83,6 +87,7 @@ CreatorNested& CreatorNested::operator=(const CreatorNested& other) } CreatorNested::CreatorNested(CreatorNested&& other) : + m_bitPosition(other.m_bitPosition), m_value_(::std::move(other.m_value_)), m_text_(::std::move(other.m_text_)), m_externData_(::std::move(other.m_externData_)), @@ -102,6 +107,7 @@ CreatorNested::CreatorNested(CreatorNested&& other) : CreatorNested& CreatorNested::operator=(CreatorNested&& other) { + m_bitPosition = other.m_bitPosition; m_value_ = ::std::move(other.m_value_); m_text_ = ::std::move(other.m_text_); m_externData_ = ::std::move(other.m_externData_); @@ -123,6 +129,7 @@ CreatorNested& CreatorNested::operator=(CreatorNested&& other) CreatorNested::CreatorNested(::zserio::NoInitT, const CreatorNested& other) : m_isInitialized(false), + m_bitPosition(other.m_bitPosition), m_value_(other.m_value_), m_text_(other.m_text_), m_externData_(other.m_externData_), @@ -136,6 +143,7 @@ CreatorNested& CreatorNested::assign(::zserio::NoInitT, const CreatorNested& other) { m_isInitialized = false; + m_bitPosition = other.m_bitPosition; m_value_ = other.m_value_; m_text_ = other.m_text_; m_externData_ = other.m_externData_; @@ -149,6 +157,7 @@ CreatorNested& CreatorNested::assign(::zserio::NoInitT, CreatorNested::CreatorNested(::zserio::NoInitT, CreatorNested&& other) : m_isInitialized(false), + m_bitPosition(other.m_bitPosition), m_value_(::std::move(other.m_value_)), m_text_(::std::move(other.m_text_)), m_externData_(::std::move(other.m_externData_)), @@ -162,6 +171,7 @@ CreatorNested& CreatorNested::assign(::zserio::NoInitT, CreatorNested&& other) { m_isInitialized = false; + m_bitPosition = other.m_bitPosition; m_value_ = ::std::move(other.m_value_); m_text_ = ::std::move(other.m_text_); m_externData_ = ::std::move(other.m_externData_); @@ -174,6 +184,7 @@ CreatorNested& CreatorNested::assign(::zserio::NoInitT, CreatorNested::CreatorNested(::zserio::PropagateAllocatorT, const CreatorNested& other, const allocator_type& allocator) : + m_bitPosition(other.m_bitPosition), m_value_(::zserio::allocatorPropagatingCopy(other.m_value_, allocator)), m_text_(::zserio::allocatorPropagatingCopy(other.m_text_, allocator)), m_externData_(::zserio::allocatorPropagatingCopy(other.m_externData_, allocator)), @@ -194,6 +205,7 @@ CreatorNested::CreatorNested(::zserio::PropagateAllocatorT, CreatorNested::CreatorNested(::zserio::PropagateAllocatorT, ::zserio::NoInitT, const CreatorNested& other, const allocator_type& allocator) : m_isInitialized(false), + m_bitPosition(other.m_bitPosition), m_value_(::zserio::allocatorPropagatingCopy(other.m_value_, allocator)), m_text_(::zserio::allocatorPropagatingCopy(other.m_text_, allocator)), m_externData_(::zserio::allocatorPropagatingCopy(other.m_externData_, allocator)), @@ -397,6 +409,11 @@ ::zserio::pmr::IReflectableConstPtr CreatorNested::reflectable(const allocator_t return ::zserio::pmr::AnyHolder(::std::cref(m_object), alloc); } + size_t bitPosition() const override + { + return m_object.bitPosition(); + } + private: const ::test_object::polymorphic_allocator::CreatorNested& m_object; }; @@ -620,6 +637,11 @@ ::zserio::pmr::IReflectablePtr CreatorNested::reflectable(const allocator_type& return ::zserio::pmr::AnyHolder(::std::ref(m_object), alloc); } + size_t bitPosition() const override + { + return m_object.bitPosition(); + } + private: ::test_object::polymorphic_allocator::CreatorNested& m_object; }; @@ -877,6 +899,11 @@ void CreatorNested::write(::zserio::BitStreamWriter& out) const m_creatorBitmask_.write(out); } +size_t CreatorNested::bitPosition() const +{ + return m_bitPosition; +} + uint32_t CreatorNested::readValue(::zserio::BitStreamReader& in) { return static_cast(in.readBits(UINT8_C(32))); diff --git a/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/CreatorNested.h b/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/CreatorNested.h index b25cef4e8..5f5cbbd73 100644 --- a/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/CreatorNested.h +++ b/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/CreatorNested.h @@ -1,6 +1,6 @@ /** * Automatically generated by Zserio C++ generator version 1.0.2 using Zserio core 2.14.1. - * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, polymorphicAllocator. + * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, bitPosition, polymorphicAllocator. */ #ifndef TEST_OBJECT_POLYMORPHIC_ALLOCATOR_CREATOR_NESTED_H @@ -131,6 +131,8 @@ class CreatorNested void write(::zserio::BitStreamWriter& out) const; + size_t bitPosition() const; + private: uint32_t readValue(::zserio::BitStreamReader& in); ::zserio::pmr::string readText(::zserio::BitStreamReader& in, @@ -144,6 +146,7 @@ class CreatorNested uint32_t m_param_; bool m_isInitialized; + size_t m_bitPosition; uint32_t m_value_; ::zserio::pmr::string m_text_; ::zserio::pmr::BitBuffer m_externData_; diff --git a/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/CreatorObject.cpp b/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/CreatorObject.cpp index 7c6c2e2f2..185820090 100644 --- a/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/CreatorObject.cpp +++ b/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/CreatorObject.cpp @@ -1,6 +1,6 @@ /** * Automatically generated by Zserio C++ generator version 1.0.2 using Zserio core 2.14.1. - * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, polymorphicAllocator. + * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, bitPosition, polymorphicAllocator. */ #include @@ -22,6 +22,7 @@ namespace polymorphic_allocator CreatorObject::CreatorObject(const allocator_type& allocator) noexcept : m_areChildrenInitialized(false), + m_bitPosition(0), m_value_(uint32_t()), m_nested_(allocator), m_text_(allocator), @@ -36,6 +37,7 @@ CreatorObject::CreatorObject(const allocator_type& allocator) noexcept : CreatorObject::CreatorObject(::zserio::BitStreamReader& in, const allocator_type& allocator) : m_areChildrenInitialized(true), + m_bitPosition(in.getBitPosition()), m_value_(readValue(in)), m_nested_(readNested(in, allocator)), m_text_(readText(in, allocator)), @@ -49,6 +51,7 @@ CreatorObject::CreatorObject(::zserio::BitStreamReader& in, const allocator_type } CreatorObject::CreatorObject(const CreatorObject& other) : + m_bitPosition(other.m_bitPosition), m_value_(other.m_value_), m_nested_(::zserio::NoInit, other.m_nested_), m_text_(other.m_text_), @@ -71,6 +74,7 @@ CreatorObject::CreatorObject(const CreatorObject& other) : CreatorObject& CreatorObject::operator=(const CreatorObject& other) { + m_bitPosition = other.m_bitPosition; m_value_ = other.m_value_; (void)m_nested_.assign(::zserio::NoInit, other.m_nested_); m_text_ = other.m_text_; @@ -93,6 +97,7 @@ CreatorObject& CreatorObject::operator=(const CreatorObject& other) } CreatorObject::CreatorObject(CreatorObject&& other) : + m_bitPosition(other.m_bitPosition), m_value_(::std::move(other.m_value_)), m_nested_(::zserio::NoInit, ::std::move(other.m_nested_)), m_text_(::std::move(other.m_text_)), @@ -115,6 +120,7 @@ CreatorObject::CreatorObject(CreatorObject&& other) : CreatorObject& CreatorObject::operator=(CreatorObject&& other) { + m_bitPosition = other.m_bitPosition; m_value_ = ::std::move(other.m_value_); (void)m_nested_.assign(::zserio::NoInit, ::std::move(other.m_nested_)); m_text_ = ::std::move(other.m_text_); @@ -138,6 +144,7 @@ CreatorObject& CreatorObject::operator=(CreatorObject&& other) CreatorObject::CreatorObject(::zserio::PropagateAllocatorT, const CreatorObject& other, const allocator_type& allocator) : + m_bitPosition(other.m_bitPosition), m_value_(::zserio::allocatorPropagatingCopy(other.m_value_, allocator)), m_nested_(::zserio::NoInit, ::zserio::allocatorPropagatingCopy(::zserio::NoInit, other.m_nested_, allocator)), m_text_(::zserio::allocatorPropagatingCopy(other.m_text_, allocator)), @@ -427,6 +434,11 @@ ::zserio::pmr::IReflectableConstPtr CreatorObject::reflectable(const allocator_t return ::zserio::pmr::AnyHolder(::std::cref(m_object), alloc); } + size_t bitPosition() const override + { + return m_object.bitPosition(); + } + private: const ::test_object::polymorphic_allocator::CreatorObject& m_object; }; @@ -721,6 +733,11 @@ ::zserio::pmr::IReflectablePtr CreatorObject::reflectable(const allocator_type& return ::zserio::pmr::AnyHolder(::std::ref(m_object), alloc); } + size_t bitPosition() const override + { + return m_object.bitPosition(); + } + private: ::test_object::polymorphic_allocator::CreatorObject& m_object; }; @@ -732,7 +749,7 @@ void CreatorObject::initializeChildren() { m_nested_.initialize(static_cast(getValue())); m_nestedArray_.initializeElements(*this); - if (isOptionalNestedSet()) + if (m_optionalNested_.hasValue()) { m_optionalNested_.value().initialize(static_cast(getValue())); } @@ -852,7 +869,7 @@ void CreatorObject::setExternArray(::zserio::pmr::vector<::zserio::pmr::BitBuffe bool CreatorObject::isExternArrayUsed() const { - return (isExternArraySet()); + return (m_externArray_.hasValue()); } bool CreatorObject::isExternArraySet() const @@ -887,7 +904,7 @@ void CreatorObject::setBytesArray(::zserio::pmr::vector<::zserio::pmr::vector diff --git a/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/CreatorUnsignedEnum.h b/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/CreatorUnsignedEnum.h index e597676c5..49a1de730 100644 --- a/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/CreatorUnsignedEnum.h +++ b/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/CreatorUnsignedEnum.h @@ -1,6 +1,6 @@ /** * Automatically generated by Zserio C++ generator version 1.0.2 using Zserio core 2.14.1. - * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, polymorphicAllocator. + * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, bitPosition, polymorphicAllocator. */ #ifndef TEST_OBJECT_POLYMORPHIC_ALLOCATOR_CREATOR_UNSIGNED_ENUM_H diff --git a/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/DebugStringObject.cpp b/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/DebugStringObject.cpp index 24ae3b314..7d25b37c8 100644 --- a/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/DebugStringObject.cpp +++ b/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/DebugStringObject.cpp @@ -1,6 +1,6 @@ /** * Automatically generated by Zserio C++ generator version 1.0.2 using Zserio core 2.14.1. - * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, polymorphicAllocator. + * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, bitPosition, polymorphicAllocator. */ #include @@ -22,17 +22,20 @@ namespace polymorphic_allocator { DebugStringObject::DebugStringObject(const allocator_type& allocator) noexcept : + m_bitPosition(0), m_text_(::zserio::stringViewToString(::zserio::makeStringView("test"), allocator)) { } DebugStringObject::DebugStringObject(::zserio::BitStreamReader& in, const allocator_type& allocator) : + m_bitPosition(in.getBitPosition()), m_text_(readText(in, allocator)) { } DebugStringObject::DebugStringObject(::zserio::PropagateAllocatorT, const DebugStringObject& other, const allocator_type& allocator) : + m_bitPosition(other.m_bitPosition), m_text_(::zserio::allocatorPropagatingCopy(other.m_text_, allocator)) { } @@ -117,6 +120,11 @@ ::zserio::pmr::IReflectableConstPtr DebugStringObject::reflectable(const allocat return ::zserio::pmr::AnyHolder(::std::cref(m_object), alloc); } + size_t bitPosition() const override + { + return m_object.bitPosition(); + } + private: const ::test_object::polymorphic_allocator::DebugStringObject& m_object; }; @@ -202,6 +210,11 @@ ::zserio::pmr::IReflectablePtr DebugStringObject::reflectable(const allocator_ty return ::zserio::pmr::AnyHolder(::std::ref(m_object), alloc); } + size_t bitPosition() const override + { + return m_object.bitPosition(); + } + private: ::test_object::polymorphic_allocator::DebugStringObject& m_object; }; @@ -286,6 +299,11 @@ void DebugStringObject::write(::zserio::BitStreamWriter& out) const out.writeString(m_text_); } +size_t DebugStringObject::bitPosition() const +{ + return m_bitPosition; +} + ::zserio::pmr::string DebugStringObject::readText(::zserio::BitStreamReader& in, const allocator_type& allocator) { diff --git a/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/DebugStringObject.h b/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/DebugStringObject.h index 4c0c8733d..d0e1b4b3c 100644 --- a/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/DebugStringObject.h +++ b/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/DebugStringObject.h @@ -1,6 +1,6 @@ /** * Automatically generated by Zserio C++ generator version 1.0.2 using Zserio core 2.14.1. - * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, polymorphicAllocator. + * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, bitPosition, polymorphicAllocator. */ #ifndef TEST_OBJECT_POLYMORPHIC_ALLOCATOR_DEBUG_STRING_OBJECT_H @@ -76,10 +76,13 @@ class DebugStringObject void write(::zserio::BitStreamWriter& out) const; + size_t bitPosition() const; + private: ::zserio::pmr::string readText(::zserio::BitStreamReader& in, const allocator_type& allocator); + size_t m_bitPosition; ::zserio::pmr::string m_text_; }; diff --git a/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/DebugStringParamObject.cpp b/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/DebugStringParamObject.cpp index 163ce6eee..ddc91549b 100644 --- a/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/DebugStringParamObject.cpp +++ b/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/DebugStringParamObject.cpp @@ -1,6 +1,6 @@ /** * Automatically generated by Zserio C++ generator version 1.0.2 using Zserio core 2.14.1. - * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, polymorphicAllocator. + * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, bitPosition, polymorphicAllocator. */ #include @@ -23,6 +23,7 @@ namespace polymorphic_allocator DebugStringParamObject::DebugStringParamObject(const allocator_type& allocator) noexcept : m_isInitialized(false), + m_bitPosition(0), m_text_(::zserio::stringViewToString(::zserio::makeStringView("test"), allocator)) { } @@ -31,11 +32,13 @@ DebugStringParamObject::DebugStringParamObject(::zserio::BitStreamReader& in, int32_t param_, const allocator_type& allocator) : m_param_(param_), m_isInitialized(true), + m_bitPosition(in.getBitPosition()), m_text_(readText(in, allocator)) { } DebugStringParamObject::DebugStringParamObject(const DebugStringParamObject& other) : + m_bitPosition(other.m_bitPosition), m_text_(other.m_text_) { if (other.m_isInitialized) @@ -50,6 +53,7 @@ DebugStringParamObject::DebugStringParamObject(const DebugStringParamObject& oth DebugStringParamObject& DebugStringParamObject::operator=(const DebugStringParamObject& other) { + m_bitPosition = other.m_bitPosition; m_text_ = other.m_text_; if (other.m_isInitialized) { @@ -64,6 +68,7 @@ DebugStringParamObject& DebugStringParamObject::operator=(const DebugStringParam } DebugStringParamObject::DebugStringParamObject(DebugStringParamObject&& other) : + m_bitPosition(other.m_bitPosition), m_text_(::std::move(other.m_text_)) { if (other.m_isInitialized) @@ -78,6 +83,7 @@ DebugStringParamObject::DebugStringParamObject(DebugStringParamObject&& other) : DebugStringParamObject& DebugStringParamObject::operator=(DebugStringParamObject&& other) { + m_bitPosition = other.m_bitPosition; m_text_ = ::std::move(other.m_text_); if (other.m_isInitialized) { @@ -94,6 +100,7 @@ DebugStringParamObject& DebugStringParamObject::operator=(DebugStringParamObject DebugStringParamObject::DebugStringParamObject(::zserio::NoInitT, const DebugStringParamObject& other) : m_isInitialized(false), + m_bitPosition(other.m_bitPosition), m_text_(other.m_text_) { } @@ -102,6 +109,7 @@ DebugStringParamObject& DebugStringParamObject::assign(::zserio::NoInitT, const DebugStringParamObject& other) { m_isInitialized = false; + m_bitPosition = other.m_bitPosition; m_text_ = other.m_text_; return *this; @@ -110,6 +118,7 @@ DebugStringParamObject& DebugStringParamObject::assign(::zserio::NoInitT, DebugStringParamObject::DebugStringParamObject(::zserio::NoInitT, DebugStringParamObject&& other) : m_isInitialized(false), + m_bitPosition(other.m_bitPosition), m_text_(::std::move(other.m_text_)) { } @@ -118,6 +127,7 @@ DebugStringParamObject& DebugStringParamObject::assign(::zserio::NoInitT, DebugStringParamObject&& other) { m_isInitialized = false; + m_bitPosition = other.m_bitPosition; m_text_ = ::std::move(other.m_text_); return *this; @@ -125,6 +135,7 @@ DebugStringParamObject& DebugStringParamObject::assign(::zserio::NoInitT, DebugStringParamObject::DebugStringParamObject(::zserio::PropagateAllocatorT, const DebugStringParamObject& other, const allocator_type& allocator) : + m_bitPosition(other.m_bitPosition), m_text_(::zserio::allocatorPropagatingCopy(other.m_text_, allocator)) { if (other.m_isInitialized) @@ -140,6 +151,7 @@ DebugStringParamObject::DebugStringParamObject(::zserio::PropagateAllocatorT, DebugStringParamObject::DebugStringParamObject(::zserio::PropagateAllocatorT, ::zserio::NoInitT, const DebugStringParamObject& other, const allocator_type& allocator) : m_isInitialized(false), + m_bitPosition(other.m_bitPosition), m_text_(::zserio::allocatorPropagatingCopy(other.m_text_, allocator)) { } @@ -238,6 +250,11 @@ ::zserio::pmr::IReflectableConstPtr DebugStringParamObject::reflectable(const al return ::zserio::pmr::AnyHolder(::std::cref(m_object), alloc); } + size_t bitPosition() const override + { + return m_object.bitPosition(); + } + private: const ::test_object::polymorphic_allocator::DebugStringParamObject& m_object; }; @@ -355,6 +372,11 @@ ::zserio::pmr::IReflectablePtr DebugStringParamObject::reflectable(const allocat return ::zserio::pmr::AnyHolder(::std::ref(m_object), alloc); } + size_t bitPosition() const override + { + return m_object.bitPosition(); + } + private: ::test_object::polymorphic_allocator::DebugStringParamObject& m_object; }; @@ -472,6 +494,11 @@ void DebugStringParamObject::write(::zserio::BitStreamWriter& out) const out.writeString(m_text_); } +size_t DebugStringParamObject::bitPosition() const +{ + return m_bitPosition; +} + ::zserio::pmr::string DebugStringParamObject::readText(::zserio::BitStreamReader& in, const allocator_type& allocator) { diff --git a/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/DebugStringParamObject.h b/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/DebugStringParamObject.h index 4297875ac..3801930d9 100644 --- a/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/DebugStringParamObject.h +++ b/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/DebugStringParamObject.h @@ -1,6 +1,6 @@ /** * Automatically generated by Zserio C++ generator version 1.0.2 using Zserio core 2.14.1. - * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, polymorphicAllocator. + * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, bitPosition, polymorphicAllocator. */ #ifndef TEST_OBJECT_POLYMORPHIC_ALLOCATOR_DEBUG_STRING_PARAM_OBJECT_H @@ -96,12 +96,15 @@ class DebugStringParamObject void write(::zserio::BitStreamWriter& out) const; + size_t bitPosition() const; + private: ::zserio::pmr::string readText(::zserio::BitStreamReader& in, const allocator_type& allocator); int32_t m_param_; bool m_isInitialized; + size_t m_bitPosition; ::zserio::pmr::string m_text_; }; diff --git a/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/ReflectableBitmask.cpp b/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/ReflectableBitmask.cpp index cc2e4fed5..c7a1c808c 100644 --- a/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/ReflectableBitmask.cpp +++ b/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/ReflectableBitmask.cpp @@ -1,6 +1,6 @@ /** * Automatically generated by Zserio C++ generator version 1.0.2 using Zserio core 2.14.1. - * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, polymorphicAllocator. + * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, bitPosition, polymorphicAllocator. */ #include diff --git a/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/ReflectableBitmask.h b/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/ReflectableBitmask.h index 74950f19a..ad1ed8220 100644 --- a/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/ReflectableBitmask.h +++ b/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/ReflectableBitmask.h @@ -1,6 +1,6 @@ /** * Automatically generated by Zserio C++ generator version 1.0.2 using Zserio core 2.14.1. - * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, polymorphicAllocator. + * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, bitPosition, polymorphicAllocator. */ #ifndef TEST_OBJECT_POLYMORPHIC_ALLOCATOR_REFLECTABLE_BITMASK_H diff --git a/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/ReflectableEnum.cpp b/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/ReflectableEnum.cpp index 8617fd0d9..e2e20247a 100644 --- a/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/ReflectableEnum.cpp +++ b/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/ReflectableEnum.cpp @@ -1,6 +1,6 @@ /** * Automatically generated by Zserio C++ generator version 1.0.2 using Zserio core 2.14.1. - * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, polymorphicAllocator. + * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, bitPosition, polymorphicAllocator. */ #include diff --git a/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/ReflectableEnum.h b/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/ReflectableEnum.h index c32953bcb..17c710fe6 100644 --- a/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/ReflectableEnum.h +++ b/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/ReflectableEnum.h @@ -1,6 +1,6 @@ /** * Automatically generated by Zserio C++ generator version 1.0.2 using Zserio core 2.14.1. - * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, polymorphicAllocator. + * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, bitPosition, polymorphicAllocator. */ #ifndef TEST_OBJECT_POLYMORPHIC_ALLOCATOR_REFLECTABLE_ENUM_H diff --git a/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/ReflectableNested.cpp b/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/ReflectableNested.cpp index 4951d5516..6dba11d86 100644 --- a/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/ReflectableNested.cpp +++ b/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/ReflectableNested.cpp @@ -1,6 +1,6 @@ /** * Automatically generated by Zserio C++ generator version 1.0.2 using Zserio core 2.14.1. - * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, polymorphicAllocator. + * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, bitPosition, polymorphicAllocator. */ #include @@ -23,6 +23,7 @@ namespace polymorphic_allocator ReflectableNested::ReflectableNested(const allocator_type&) noexcept : m_isInitialized(false), + m_bitPosition(0), m_value_(uint32_t()) { } @@ -33,11 +34,13 @@ ReflectableNested::ReflectableNested(::zserio::BitStreamReader& in, m_dummyParam_(dummyParam_), m_stringParam_(&stringParam_), m_isInitialized(true), + m_bitPosition(in.getBitPosition()), m_value_(readValue(in)) { } ReflectableNested::ReflectableNested(const ReflectableNested& other) : + m_bitPosition(other.m_bitPosition), m_value_(other.m_value_) { if (other.m_isInitialized) @@ -52,6 +55,7 @@ ReflectableNested::ReflectableNested(const ReflectableNested& other) : ReflectableNested& ReflectableNested::operator=(const ReflectableNested& other) { + m_bitPosition = other.m_bitPosition; m_value_ = other.m_value_; if (other.m_isInitialized) { @@ -66,6 +70,7 @@ ReflectableNested& ReflectableNested::operator=(const ReflectableNested& other) } ReflectableNested::ReflectableNested(ReflectableNested&& other) : + m_bitPosition(other.m_bitPosition), m_value_(::std::move(other.m_value_)) { if (other.m_isInitialized) @@ -80,6 +85,7 @@ ReflectableNested::ReflectableNested(ReflectableNested&& other) : ReflectableNested& ReflectableNested::operator=(ReflectableNested&& other) { + m_bitPosition = other.m_bitPosition; m_value_ = ::std::move(other.m_value_); if (other.m_isInitialized) { @@ -96,6 +102,7 @@ ReflectableNested& ReflectableNested::operator=(ReflectableNested&& other) ReflectableNested::ReflectableNested(::zserio::NoInitT, const ReflectableNested& other) : m_isInitialized(false), + m_bitPosition(other.m_bitPosition), m_value_(other.m_value_) { } @@ -104,6 +111,7 @@ ReflectableNested& ReflectableNested::assign(::zserio::NoInitT, const ReflectableNested& other) { m_isInitialized = false; + m_bitPosition = other.m_bitPosition; m_value_ = other.m_value_; return *this; @@ -112,6 +120,7 @@ ReflectableNested& ReflectableNested::assign(::zserio::NoInitT, ReflectableNested::ReflectableNested(::zserio::NoInitT, ReflectableNested&& other) : m_isInitialized(false), + m_bitPosition(other.m_bitPosition), m_value_(::std::move(other.m_value_)) { } @@ -120,6 +129,7 @@ ReflectableNested& ReflectableNested::assign(::zserio::NoInitT, ReflectableNested&& other) { m_isInitialized = false; + m_bitPosition = other.m_bitPosition; m_value_ = ::std::move(other.m_value_); return *this; @@ -127,6 +137,7 @@ ReflectableNested& ReflectableNested::assign(::zserio::NoInitT, ReflectableNested::ReflectableNested(::zserio::PropagateAllocatorT, const ReflectableNested& other, const allocator_type& allocator) : + m_bitPosition(other.m_bitPosition), m_value_(::zserio::allocatorPropagatingCopy(other.m_value_, allocator)) { if (other.m_isInitialized) @@ -142,6 +153,7 @@ ReflectableNested::ReflectableNested(::zserio::PropagateAllocatorT, ReflectableNested::ReflectableNested(::zserio::PropagateAllocatorT, ::zserio::NoInitT, const ReflectableNested& other, const allocator_type& allocator) : m_isInitialized(false), + m_bitPosition(other.m_bitPosition), m_value_(::zserio::allocatorPropagatingCopy(other.m_value_, allocator)) { } @@ -263,6 +275,11 @@ ::zserio::pmr::IReflectableConstPtr ReflectableNested::reflectable(const allocat return ::zserio::pmr::AnyHolder(::std::cref(m_object), alloc); } + size_t bitPosition() const override + { + return m_object.bitPosition(); + } + private: const ::test_object::polymorphic_allocator::ReflectableNested& m_object; }; @@ -407,6 +424,11 @@ ::zserio::pmr::IReflectablePtr ReflectableNested::reflectable(const allocator_ty return ::zserio::pmr::AnyHolder(::std::ref(m_object), alloc); } + size_t bitPosition() const override + { + return m_object.bitPosition(); + } + private: ::test_object::polymorphic_allocator::ReflectableNested& m_object; }; @@ -552,6 +574,11 @@ void ReflectableNested::write(::zserio::BitStreamWriter& out) const out.writeBits(m_value_, UINT8_C(31)); } +size_t ReflectableNested::bitPosition() const +{ + return m_bitPosition; +} + uint32_t ReflectableNested::readValue(::zserio::BitStreamReader& in) { return static_cast(in.readBits(UINT8_C(31))); diff --git a/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/ReflectableNested.h b/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/ReflectableNested.h index 366b2b408..7cb8430f2 100644 --- a/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/ReflectableNested.h +++ b/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/ReflectableNested.h @@ -1,6 +1,6 @@ /** * Automatically generated by Zserio C++ generator version 1.0.2 using Zserio core 2.14.1. - * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, polymorphicAllocator. + * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, bitPosition, polymorphicAllocator. */ #ifndef TEST_OBJECT_POLYMORPHIC_ALLOCATOR_REFLECTABLE_NESTED_H @@ -99,12 +99,15 @@ class ReflectableNested void write(::zserio::BitStreamWriter& out) const; + size_t bitPosition() const; + private: uint32_t readValue(::zserio::BitStreamReader& in); int32_t m_dummyParam_; ::zserio::pmr::string* m_stringParam_; bool m_isInitialized; + size_t m_bitPosition; uint32_t m_value_; }; diff --git a/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/ReflectableObject.cpp b/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/ReflectableObject.cpp index 709fc55fa..6ba6db746 100644 --- a/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/ReflectableObject.cpp +++ b/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/ReflectableObject.cpp @@ -1,6 +1,6 @@ /** * Automatically generated by Zserio C++ generator version 1.0.2 using Zserio core 2.14.1. - * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, polymorphicAllocator. + * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, bitPosition, polymorphicAllocator. */ #include @@ -22,6 +22,7 @@ namespace polymorphic_allocator ReflectableObject::ReflectableObject(const allocator_type& allocator) noexcept : m_areChildrenInitialized(false), + m_bitPosition(0), m_stringField_(allocator), m_reflectableNested_(allocator) { @@ -29,12 +30,14 @@ ReflectableObject::ReflectableObject(const allocator_type& allocator) noexcept : ReflectableObject::ReflectableObject(::zserio::BitStreamReader& in, const allocator_type& allocator) : m_areChildrenInitialized(true), + m_bitPosition(in.getBitPosition()), m_stringField_(readStringField(in, allocator)), m_reflectableNested_(readReflectableNested(in, allocator)) { } ReflectableObject::ReflectableObject(const ReflectableObject& other) : + m_bitPosition(other.m_bitPosition), m_stringField_(other.m_stringField_), m_reflectableNested_(::zserio::NoInit, other.m_reflectableNested_) { @@ -50,6 +53,7 @@ ReflectableObject::ReflectableObject(const ReflectableObject& other) : ReflectableObject& ReflectableObject::operator=(const ReflectableObject& other) { + m_bitPosition = other.m_bitPosition; m_stringField_ = other.m_stringField_; (void)m_reflectableNested_.assign(::zserio::NoInit, other.m_reflectableNested_); if (other.m_areChildrenInitialized) @@ -65,6 +69,7 @@ ReflectableObject& ReflectableObject::operator=(const ReflectableObject& other) } ReflectableObject::ReflectableObject(ReflectableObject&& other) : + m_bitPosition(other.m_bitPosition), m_stringField_(::std::move(other.m_stringField_)), m_reflectableNested_(::zserio::NoInit, ::std::move(other.m_reflectableNested_)) { @@ -80,6 +85,7 @@ ReflectableObject::ReflectableObject(ReflectableObject&& other) : ReflectableObject& ReflectableObject::operator=(ReflectableObject&& other) { + m_bitPosition = other.m_bitPosition; m_stringField_ = ::std::move(other.m_stringField_); (void)m_reflectableNested_.assign(::zserio::NoInit, ::std::move(other.m_reflectableNested_)); if (other.m_areChildrenInitialized) @@ -96,6 +102,7 @@ ReflectableObject& ReflectableObject::operator=(ReflectableObject&& other) ReflectableObject::ReflectableObject(::zserio::PropagateAllocatorT, const ReflectableObject& other, const allocator_type& allocator) : + m_bitPosition(other.m_bitPosition), m_stringField_(::zserio::allocatorPropagatingCopy(other.m_stringField_, allocator)), m_reflectableNested_(::zserio::NoInit, ::zserio::allocatorPropagatingCopy(::zserio::NoInit, other.m_reflectableNested_, allocator)) { @@ -213,6 +220,11 @@ ::zserio::pmr::IReflectableConstPtr ReflectableObject::reflectable(const allocat return ::zserio::pmr::AnyHolder(::std::cref(m_object), alloc); } + size_t bitPosition() const override + { + return m_object.bitPosition(); + } + private: const ::test_object::polymorphic_allocator::ReflectableObject& m_object; }; @@ -317,6 +329,11 @@ ::zserio::pmr::IReflectablePtr ReflectableObject::reflectable(const allocator_ty return ::zserio::pmr::AnyHolder(::std::ref(m_object), alloc); } + size_t bitPosition() const override + { + return m_object.bitPosition(); + } + private: ::test_object::polymorphic_allocator::ReflectableObject& m_object; }; @@ -453,6 +470,11 @@ void ReflectableObject::write(::zserio::BitStreamWriter& out) const m_reflectableNested_.write(out); } +size_t ReflectableObject::bitPosition() const +{ + return m_bitPosition; +} + ::zserio::pmr::string ReflectableObject::readStringField(::zserio::BitStreamReader& in, const allocator_type& allocator) { diff --git a/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/ReflectableObject.h b/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/ReflectableObject.h index 5208f9032..689cd5091 100644 --- a/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/ReflectableObject.h +++ b/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/ReflectableObject.h @@ -1,6 +1,6 @@ /** * Automatically generated by Zserio C++ generator version 1.0.2 using Zserio core 2.14.1. - * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, polymorphicAllocator. + * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, bitPosition, polymorphicAllocator. */ #ifndef TEST_OBJECT_POLYMORPHIC_ALLOCATOR_REFLECTABLE_OBJECT_H @@ -90,6 +90,8 @@ class ReflectableObject void write(::zserio::BitStreamWriter& out) const; + size_t bitPosition() const; + private: ::zserio::pmr::string readStringField(::zserio::BitStreamReader& in, const allocator_type& allocator); @@ -97,6 +99,7 @@ class ReflectableObject const allocator_type& allocator); bool m_areChildrenInitialized; + size_t m_bitPosition; ::zserio::pmr::string m_stringField_; ::test_object::polymorphic_allocator::ReflectableNested m_reflectableNested_; }; diff --git a/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/ReflectableUtilBitmask.cpp b/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/ReflectableUtilBitmask.cpp index 182b7ccb4..8372a3020 100644 --- a/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/ReflectableUtilBitmask.cpp +++ b/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/ReflectableUtilBitmask.cpp @@ -1,6 +1,6 @@ /** * Automatically generated by Zserio C++ generator version 1.0.2 using Zserio core 2.14.1. - * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, polymorphicAllocator. + * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, bitPosition, polymorphicAllocator. */ #include diff --git a/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/ReflectableUtilBitmask.h b/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/ReflectableUtilBitmask.h index 502cba5e5..aba6ccd80 100644 --- a/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/ReflectableUtilBitmask.h +++ b/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/ReflectableUtilBitmask.h @@ -1,6 +1,6 @@ /** * Automatically generated by Zserio C++ generator version 1.0.2 using Zserio core 2.14.1. - * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, polymorphicAllocator. + * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, bitPosition, polymorphicAllocator. */ #ifndef TEST_OBJECT_POLYMORPHIC_ALLOCATOR_REFLECTABLE_UTIL_BITMASK_H diff --git a/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/ReflectableUtilChoice.cpp b/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/ReflectableUtilChoice.cpp index 725d42128..cc48063bb 100644 --- a/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/ReflectableUtilChoice.cpp +++ b/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/ReflectableUtilChoice.cpp @@ -1,6 +1,6 @@ /** * Automatically generated by Zserio C++ generator version 1.0.2 using Zserio core 2.14.1. - * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, polymorphicAllocator. + * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, bitPosition, polymorphicAllocator. */ #include @@ -21,6 +21,7 @@ namespace polymorphic_allocator ReflectableUtilChoice::ReflectableUtilChoice(const allocator_type& allocator) noexcept : m_isInitialized(false), + m_bitPosition(0), m_objectChoice(allocator) { } @@ -29,11 +30,13 @@ ReflectableUtilChoice::ReflectableUtilChoice(::zserio::BitStreamReader& in, uint8_t param_, const allocator_type& allocator) : m_param_(param_), m_isInitialized(true), + m_bitPosition(in.getBitPosition()), m_objectChoice(readObject(in, allocator), allocator) { } ReflectableUtilChoice::ReflectableUtilChoice(const ReflectableUtilChoice& other) : + m_bitPosition(other.m_bitPosition), m_objectChoice(::zserio::NoInit, other.m_objectChoice) { if (other.m_isInitialized) @@ -48,6 +51,7 @@ ReflectableUtilChoice::ReflectableUtilChoice(const ReflectableUtilChoice& other) ReflectableUtilChoice& ReflectableUtilChoice::operator=(const ReflectableUtilChoice& other) { + m_bitPosition = other.m_bitPosition; (void)m_objectChoice.assign(::zserio::NoInit, other.m_objectChoice); if (other.m_isInitialized) { @@ -62,6 +66,7 @@ ReflectableUtilChoice& ReflectableUtilChoice::operator=(const ReflectableUtilCho } ReflectableUtilChoice::ReflectableUtilChoice(ReflectableUtilChoice&& other) : + m_bitPosition(other.m_bitPosition), m_objectChoice(::zserio::NoInit, ::std::move(other.m_objectChoice)) { if (other.m_isInitialized) @@ -76,6 +81,7 @@ ReflectableUtilChoice::ReflectableUtilChoice(ReflectableUtilChoice&& other) : ReflectableUtilChoice& ReflectableUtilChoice::operator=(ReflectableUtilChoice&& other) { + m_bitPosition = other.m_bitPosition; (void)m_objectChoice.assign(::zserio::NoInit, ::std::move(other.m_objectChoice)); if (other.m_isInitialized) { @@ -92,6 +98,7 @@ ReflectableUtilChoice& ReflectableUtilChoice::operator=(ReflectableUtilChoice&& ReflectableUtilChoice::ReflectableUtilChoice(::zserio::NoInitT, const ReflectableUtilChoice& other) : m_isInitialized(false), + m_bitPosition(other.m_bitPosition), m_objectChoice(::zserio::NoInit, other.m_objectChoice) { } @@ -100,6 +107,7 @@ ReflectableUtilChoice& ReflectableUtilChoice::assign(::zserio::NoInitT, const ReflectableUtilChoice& other) { m_isInitialized = false; + m_bitPosition = other.m_bitPosition; (void)m_objectChoice.assign(::zserio::NoInit, other.m_objectChoice); return *this; @@ -108,6 +116,7 @@ ReflectableUtilChoice& ReflectableUtilChoice::assign(::zserio::NoInitT, ReflectableUtilChoice::ReflectableUtilChoice(::zserio::NoInitT, ReflectableUtilChoice&& other) : m_isInitialized(false), + m_bitPosition(other.m_bitPosition), m_objectChoice(::zserio::NoInit, ::std::move(other.m_objectChoice)) { } @@ -116,6 +125,7 @@ ReflectableUtilChoice& ReflectableUtilChoice::assign(::zserio::NoInitT, ReflectableUtilChoice&& other) { m_isInitialized = false; + m_bitPosition = other.m_bitPosition; (void)m_objectChoice.assign(::zserio::NoInit, ::std::move(other.m_objectChoice)); return *this; @@ -123,6 +133,7 @@ ReflectableUtilChoice& ReflectableUtilChoice::assign(::zserio::NoInitT, ReflectableUtilChoice::ReflectableUtilChoice(::zserio::PropagateAllocatorT, const ReflectableUtilChoice& other, const allocator_type& allocator) : + m_bitPosition(other.m_bitPosition), m_objectChoice(::zserio::NoInit, other.copyObject(allocator)) { if (other.m_isInitialized) @@ -138,6 +149,7 @@ ReflectableUtilChoice::ReflectableUtilChoice(::zserio::PropagateAllocatorT, ReflectableUtilChoice::ReflectableUtilChoice(::zserio::PropagateAllocatorT, ::zserio::NoInitT, const ReflectableUtilChoice& other, const allocator_type& allocator) : m_isInitialized(false), + m_bitPosition(other.m_bitPosition), m_objectChoice(::zserio::NoInit, other.copyObject(allocator)) { } @@ -262,6 +274,11 @@ ::zserio::pmr::IReflectableConstPtr ReflectableUtilChoice::reflectable(const all return ::zserio::pmr::AnyHolder(::std::cref(m_object), alloc); } + size_t bitPosition() const override + { + return m_object.bitPosition(); + } + private: const ::test_object::polymorphic_allocator::ReflectableUtilChoice& m_object; }; @@ -391,13 +408,17 @@ ::zserio::pmr::IReflectablePtr ReflectableUtilChoice::reflectable(const allocato return ::zserio::pmr::AnyHolder(::std::ref(m_object), alloc); } + size_t bitPosition() const override + { + return m_object.bitPosition(); + } + private: ::test_object::polymorphic_allocator::ReflectableUtilChoice& m_object; }; return std::allocate_shared(allocator, *this, allocator); } - void ReflectableUtilChoice::initialize( uint8_t param_) { @@ -576,6 +597,11 @@ void ReflectableUtilChoice::write(::zserio::BitStreamWriter& out) const } } +size_t ReflectableUtilChoice::bitPosition() const +{ + return m_bitPosition; +} + ::zserio::pmr::AnyHolder ReflectableUtilChoice::readObject(::zserio::BitStreamReader& in, const allocator_type& allocator) { switch (getParam()) diff --git a/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/ReflectableUtilChoice.h b/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/ReflectableUtilChoice.h index 51b57a80c..9b71b1af9 100644 --- a/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/ReflectableUtilChoice.h +++ b/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/ReflectableUtilChoice.h @@ -1,6 +1,6 @@ /** * Automatically generated by Zserio C++ generator version 1.0.2 using Zserio core 2.14.1. - * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, polymorphicAllocator. + * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, bitPosition, polymorphicAllocator. */ #ifndef TEST_OBJECT_POLYMORPHIC_ALLOCATOR_REFLECTABLE_UTIL_CHOICE_H @@ -95,6 +95,8 @@ class ReflectableUtilChoice void write(::zserio::BitStreamWriter& out) const; + size_t bitPosition() const; + private: using ZserioArrayType_array = ::zserio::Array<::zserio::pmr::vector, ::zserio::StdIntArrayTraits, ::zserio::ArrayType::AUTO>; @@ -103,6 +105,7 @@ class ReflectableUtilChoice uint8_t m_param_; bool m_isInitialized; + size_t m_bitPosition; ::zserio::pmr::AnyHolder m_objectChoice; }; diff --git a/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/ReflectableUtilEnum.cpp b/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/ReflectableUtilEnum.cpp index c014d8b88..9d4b475d7 100644 --- a/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/ReflectableUtilEnum.cpp +++ b/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/ReflectableUtilEnum.cpp @@ -1,6 +1,6 @@ /** * Automatically generated by Zserio C++ generator version 1.0.2 using Zserio core 2.14.1. - * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, polymorphicAllocator. + * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, bitPosition, polymorphicAllocator. */ #include diff --git a/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/ReflectableUtilEnum.h b/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/ReflectableUtilEnum.h index b6344b537..4a551e6ca 100644 --- a/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/ReflectableUtilEnum.h +++ b/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/ReflectableUtilEnum.h @@ -1,6 +1,6 @@ /** * Automatically generated by Zserio C++ generator version 1.0.2 using Zserio core 2.14.1. - * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, polymorphicAllocator. + * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, bitPosition, polymorphicAllocator. */ #ifndef TEST_OBJECT_POLYMORPHIC_ALLOCATOR_REFLECTABLE_UTIL_ENUM_H diff --git a/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/ReflectableUtilObject.cpp b/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/ReflectableUtilObject.cpp index c96d27cae..ae6594e36 100644 --- a/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/ReflectableUtilObject.cpp +++ b/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/ReflectableUtilObject.cpp @@ -1,6 +1,6 @@ /** * Automatically generated by Zserio C++ generator version 1.0.2 using Zserio core 2.14.1. - * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, polymorphicAllocator. + * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, bitPosition, polymorphicAllocator. */ #include @@ -22,6 +22,7 @@ namespace polymorphic_allocator ReflectableUtilObject::ReflectableUtilObject(const allocator_type& allocator) noexcept : m_areChildrenInitialized(false), + m_bitPosition(0), m_choiceParam_(uint8_t()), m_reflectableUtilChoice_(allocator) { @@ -29,12 +30,14 @@ ReflectableUtilObject::ReflectableUtilObject(const allocator_type& allocator) no ReflectableUtilObject::ReflectableUtilObject(::zserio::BitStreamReader& in, const allocator_type& allocator) : m_areChildrenInitialized(true), + m_bitPosition(in.getBitPosition()), m_choiceParam_(readChoiceParam(in)), m_reflectableUtilChoice_(readReflectableUtilChoice(in, allocator)) { } ReflectableUtilObject::ReflectableUtilObject(const ReflectableUtilObject& other) : + m_bitPosition(other.m_bitPosition), m_choiceParam_(other.m_choiceParam_), m_reflectableUtilChoice_(::zserio::NoInit, other.m_reflectableUtilChoice_) { @@ -50,6 +53,7 @@ ReflectableUtilObject::ReflectableUtilObject(const ReflectableUtilObject& other) ReflectableUtilObject& ReflectableUtilObject::operator=(const ReflectableUtilObject& other) { + m_bitPosition = other.m_bitPosition; m_choiceParam_ = other.m_choiceParam_; (void)m_reflectableUtilChoice_.assign(::zserio::NoInit, other.m_reflectableUtilChoice_); if (other.m_areChildrenInitialized) @@ -65,6 +69,7 @@ ReflectableUtilObject& ReflectableUtilObject::operator=(const ReflectableUtilObj } ReflectableUtilObject::ReflectableUtilObject(ReflectableUtilObject&& other) : + m_bitPosition(other.m_bitPosition), m_choiceParam_(::std::move(other.m_choiceParam_)), m_reflectableUtilChoice_(::zserio::NoInit, ::std::move(other.m_reflectableUtilChoice_)) { @@ -80,6 +85,7 @@ ReflectableUtilObject::ReflectableUtilObject(ReflectableUtilObject&& other) : ReflectableUtilObject& ReflectableUtilObject::operator=(ReflectableUtilObject&& other) { + m_bitPosition = other.m_bitPosition; m_choiceParam_ = ::std::move(other.m_choiceParam_); (void)m_reflectableUtilChoice_.assign(::zserio::NoInit, ::std::move(other.m_reflectableUtilChoice_)); if (other.m_areChildrenInitialized) @@ -96,6 +102,7 @@ ReflectableUtilObject& ReflectableUtilObject::operator=(ReflectableUtilObject&& ReflectableUtilObject::ReflectableUtilObject(::zserio::PropagateAllocatorT, const ReflectableUtilObject& other, const allocator_type& allocator) : + m_bitPosition(other.m_bitPosition), m_choiceParam_(::zserio::allocatorPropagatingCopy(other.m_choiceParam_, allocator)), m_reflectableUtilChoice_(::zserio::NoInit, ::zserio::allocatorPropagatingCopy(::zserio::NoInit, other.m_reflectableUtilChoice_, allocator)) { @@ -212,6 +219,11 @@ ::zserio::pmr::IReflectableConstPtr ReflectableUtilObject::reflectable(const all return ::zserio::pmr::AnyHolder(::std::cref(m_object), alloc); } + size_t bitPosition() const override + { + return m_object.bitPosition(); + } + private: const ::test_object::polymorphic_allocator::ReflectableUtilObject& m_object; }; @@ -316,6 +328,11 @@ ::zserio::pmr::IReflectablePtr ReflectableUtilObject::reflectable(const allocato return ::zserio::pmr::AnyHolder(::std::ref(m_object), alloc); } + size_t bitPosition() const override + { + return m_object.bitPosition(); + } + private: ::test_object::polymorphic_allocator::ReflectableUtilObject& m_object; }; @@ -438,6 +455,11 @@ void ReflectableUtilObject::write(::zserio::BitStreamWriter& out) const m_reflectableUtilChoice_.write(out); } +size_t ReflectableUtilObject::bitPosition() const +{ + return m_bitPosition; +} + uint8_t ReflectableUtilObject::readChoiceParam(::zserio::BitStreamReader& in) { return static_cast(in.readBits(UINT8_C(8))); diff --git a/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/ReflectableUtilObject.h b/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/ReflectableUtilObject.h index 5a2a25aa6..597522de1 100644 --- a/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/ReflectableUtilObject.h +++ b/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/ReflectableUtilObject.h @@ -1,6 +1,6 @@ /** * Automatically generated by Zserio C++ generator version 1.0.2 using Zserio core 2.14.1. - * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, polymorphicAllocator. + * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, bitPosition, polymorphicAllocator. */ #ifndef TEST_OBJECT_POLYMORPHIC_ALLOCATOR_REFLECTABLE_UTIL_OBJECT_H @@ -84,12 +84,15 @@ class ReflectableUtilObject void write(::zserio::BitStreamWriter& out) const; + size_t bitPosition() const; + private: uint8_t readChoiceParam(::zserio::BitStreamReader& in); ::test_object::polymorphic_allocator::ReflectableUtilChoice readReflectableUtilChoice(::zserio::BitStreamReader& in, const allocator_type& allocator); bool m_areChildrenInitialized; + size_t m_bitPosition; uint8_t m_choiceParam_; ::test_object::polymorphic_allocator::ReflectableUtilChoice m_reflectableUtilChoice_; }; diff --git a/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/ReflectableUtilUnion.cpp b/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/ReflectableUtilUnion.cpp index 09ab31d53..b37bd2196 100644 --- a/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/ReflectableUtilUnion.cpp +++ b/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/ReflectableUtilUnion.cpp @@ -1,6 +1,6 @@ /** * Automatically generated by Zserio C++ generator version 1.0.2 using Zserio core 2.14.1. - * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, polymorphicAllocator. + * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, bitPosition, polymorphicAllocator. */ #include @@ -20,12 +20,14 @@ namespace polymorphic_allocator { ReflectableUtilUnion::ReflectableUtilUnion(const allocator_type& allocator) noexcept : + m_bitPosition(0), m_choiceTag(UNDEFINED_CHOICE), m_objectChoice(allocator) { } ReflectableUtilUnion::ReflectableUtilUnion(::zserio::BitStreamReader& in, const allocator_type& allocator) : + m_bitPosition(in.getBitPosition()), m_choiceTag(readChoiceTag(in)), m_objectChoice(readObject(in, allocator)) { @@ -33,6 +35,7 @@ ReflectableUtilUnion::ReflectableUtilUnion(::zserio::BitStreamReader& in, const ReflectableUtilUnion::ReflectableUtilUnion(::zserio::PropagateAllocatorT, const ReflectableUtilUnion& other, const allocator_type& allocator) : + m_bitPosition(other.m_bitPosition), m_choiceTag(other.m_choiceTag), m_objectChoice(::zserio::NoInit, other.copyObject(allocator)) { @@ -173,6 +176,11 @@ ::zserio::pmr::IReflectableConstPtr ReflectableUtilUnion::reflectable(const allo return ::zserio::pmr::AnyHolder(::std::cref(m_object), alloc); } + size_t bitPosition() const override + { + return m_object.bitPosition(); + } + private: const ::test_object::polymorphic_allocator::ReflectableUtilUnion& m_object; }; @@ -326,6 +334,11 @@ ::zserio::pmr::IReflectablePtr ReflectableUtilUnion::reflectable(const allocator return ::zserio::pmr::AnyHolder(::std::ref(m_object), alloc); } + size_t bitPosition() const override + { + return m_object.bitPosition(); + } + private: ::test_object::polymorphic_allocator::ReflectableUtilUnion& m_object; }; @@ -575,6 +588,11 @@ void ReflectableUtilUnion::write(::zserio::BitStreamWriter& out) const } } +size_t ReflectableUtilUnion::bitPosition() const +{ + return m_bitPosition; +} + ReflectableUtilUnion::ChoiceTag ReflectableUtilUnion::readChoiceTag(::zserio::BitStreamReader& in) { return static_cast(static_cast(in.readVarSize())); diff --git a/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/ReflectableUtilUnion.h b/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/ReflectableUtilUnion.h index a3f2d965a..5ee1b8c24 100644 --- a/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/ReflectableUtilUnion.h +++ b/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/ReflectableUtilUnion.h @@ -1,6 +1,6 @@ /** * Automatically generated by Zserio C++ generator version 1.0.2 using Zserio core 2.14.1. - * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, polymorphicAllocator. + * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, bitPosition, polymorphicAllocator. */ #ifndef TEST_OBJECT_POLYMORPHIC_ALLOCATOR_REFLECTABLE_UTIL_UNION_H @@ -88,11 +88,14 @@ class ReflectableUtilUnion void write(::zserio::BitStreamWriter& out) const; + size_t bitPosition() const; + private: ChoiceTag readChoiceTag(::zserio::BitStreamReader& in); ::zserio::pmr::AnyHolder readObject(::zserio::BitStreamReader& in, const allocator_type& allocator); ::zserio::pmr::AnyHolder copyObject(const allocator_type& allocator) const; + size_t m_bitPosition; ChoiceTag m_choiceTag; ::zserio::pmr::AnyHolder m_objectChoice; }; diff --git a/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/SerializeEnum.cpp b/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/SerializeEnum.cpp index ad97e9d7c..4ee93102b 100644 --- a/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/SerializeEnum.cpp +++ b/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/SerializeEnum.cpp @@ -1,6 +1,6 @@ /** * Automatically generated by Zserio C++ generator version 1.0.2 using Zserio core 2.14.1. - * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, polymorphicAllocator. + * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, bitPosition, polymorphicAllocator. */ #include diff --git a/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/SerializeEnum.h b/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/SerializeEnum.h index deaca9be2..3ead866ff 100644 --- a/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/SerializeEnum.h +++ b/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/SerializeEnum.h @@ -1,6 +1,6 @@ /** * Automatically generated by Zserio C++ generator version 1.0.2 using Zserio core 2.14.1. - * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, polymorphicAllocator. + * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, bitPosition, polymorphicAllocator. */ #ifndef TEST_OBJECT_POLYMORPHIC_ALLOCATOR_SERIALIZE_ENUM_H diff --git a/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/SerializeNested.cpp b/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/SerializeNested.cpp index b331c5b9c..6b71e5786 100644 --- a/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/SerializeNested.cpp +++ b/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/SerializeNested.cpp @@ -1,6 +1,6 @@ /** * Automatically generated by Zserio C++ generator version 1.0.2 using Zserio core 2.14.1. - * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, polymorphicAllocator. + * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, bitPosition, polymorphicAllocator. */ #include @@ -22,6 +22,7 @@ namespace polymorphic_allocator SerializeNested::SerializeNested(const allocator_type&) noexcept : m_isInitialized(false), + m_bitPosition(0), m_offset_(uint8_t()), m_optionalValue_(::zserio::NullOpt) { @@ -31,12 +32,14 @@ SerializeNested::SerializeNested(::zserio::BitStreamReader& in, int8_t param_, const allocator_type&) : m_param_(param_), m_isInitialized(true), + m_bitPosition(in.getBitPosition()), m_offset_(readOffset(in)), m_optionalValue_(readOptionalValue(in)) { } SerializeNested::SerializeNested(const SerializeNested& other) : + m_bitPosition(other.m_bitPosition), m_offset_(other.m_offset_), m_optionalValue_(other.m_optionalValue_) { @@ -52,6 +55,7 @@ SerializeNested::SerializeNested(const SerializeNested& other) : SerializeNested& SerializeNested::operator=(const SerializeNested& other) { + m_bitPosition = other.m_bitPosition; m_offset_ = other.m_offset_; m_optionalValue_ = other.m_optionalValue_; if (other.m_isInitialized) @@ -67,6 +71,7 @@ SerializeNested& SerializeNested::operator=(const SerializeNested& other) } SerializeNested::SerializeNested(SerializeNested&& other) : + m_bitPosition(other.m_bitPosition), m_offset_(::std::move(other.m_offset_)), m_optionalValue_(::std::move(other.m_optionalValue_)) { @@ -82,6 +87,7 @@ SerializeNested::SerializeNested(SerializeNested&& other) : SerializeNested& SerializeNested::operator=(SerializeNested&& other) { + m_bitPosition = other.m_bitPosition; m_offset_ = ::std::move(other.m_offset_); m_optionalValue_ = ::std::move(other.m_optionalValue_); if (other.m_isInitialized) @@ -99,6 +105,7 @@ SerializeNested& SerializeNested::operator=(SerializeNested&& other) SerializeNested::SerializeNested(::zserio::NoInitT, const SerializeNested& other) : m_isInitialized(false), + m_bitPosition(other.m_bitPosition), m_offset_(other.m_offset_), m_optionalValue_(other.m_optionalValue_) { @@ -108,6 +115,7 @@ SerializeNested& SerializeNested::assign(::zserio::NoInitT, const SerializeNested& other) { m_isInitialized = false; + m_bitPosition = other.m_bitPosition; m_offset_ = other.m_offset_; m_optionalValue_ = other.m_optionalValue_; @@ -117,6 +125,7 @@ SerializeNested& SerializeNested::assign(::zserio::NoInitT, SerializeNested::SerializeNested(::zserio::NoInitT, SerializeNested&& other) : m_isInitialized(false), + m_bitPosition(other.m_bitPosition), m_offset_(::std::move(other.m_offset_)), m_optionalValue_(::std::move(other.m_optionalValue_)) { @@ -126,6 +135,7 @@ SerializeNested& SerializeNested::assign(::zserio::NoInitT, SerializeNested&& other) { m_isInitialized = false; + m_bitPosition = other.m_bitPosition; m_offset_ = ::std::move(other.m_offset_); m_optionalValue_ = ::std::move(other.m_optionalValue_); @@ -134,6 +144,7 @@ SerializeNested& SerializeNested::assign(::zserio::NoInitT, SerializeNested::SerializeNested(::zserio::PropagateAllocatorT, const SerializeNested& other, const allocator_type& allocator) : + m_bitPosition(other.m_bitPosition), m_offset_(::zserio::allocatorPropagatingCopy(other.m_offset_, allocator)), m_optionalValue_(::zserio::allocatorPropagatingCopy(other.m_optionalValue_, allocator)) { @@ -150,6 +161,7 @@ SerializeNested::SerializeNested(::zserio::PropagateAllocatorT, SerializeNested::SerializeNested(::zserio::PropagateAllocatorT, ::zserio::NoInitT, const SerializeNested& other, const allocator_type& allocator) : m_isInitialized(false), + m_bitPosition(other.m_bitPosition), m_offset_(::zserio::allocatorPropagatingCopy(other.m_offset_, allocator)), m_optionalValue_(::zserio::allocatorPropagatingCopy(other.m_optionalValue_, allocator)) { @@ -274,6 +286,11 @@ ::zserio::pmr::IReflectableConstPtr SerializeNested::reflectable(const allocator return ::zserio::pmr::AnyHolder(::std::cref(m_object), alloc); } + size_t bitPosition() const override + { + return m_object.bitPosition(); + } + private: const ::test_object::polymorphic_allocator::SerializeNested& m_object; }; @@ -425,6 +442,11 @@ ::zserio::pmr::IReflectablePtr SerializeNested::reflectable(const allocator_type return ::zserio::pmr::AnyHolder(::std::ref(m_object), alloc); } + size_t bitPosition() const override + { + return m_object.bitPosition(); + } + private: ::test_object::polymorphic_allocator::SerializeNested& m_object; }; @@ -605,6 +627,11 @@ void SerializeNested::write(::zserio::BitStreamWriter& out) const } } +size_t SerializeNested::bitPosition() const +{ + return m_bitPosition; +} + uint8_t SerializeNested::readOffset(::zserio::BitStreamReader& in) { return static_cast(in.readBits(UINT8_C(8))); diff --git a/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/SerializeNested.h b/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/SerializeNested.h index 5c5536b63..57ccdde2b 100644 --- a/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/SerializeNested.h +++ b/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/SerializeNested.h @@ -1,6 +1,6 @@ /** * Automatically generated by Zserio C++ generator version 1.0.2 using Zserio core 2.14.1. - * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, polymorphicAllocator. + * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, bitPosition, polymorphicAllocator. */ #ifndef TEST_OBJECT_POLYMORPHIC_ALLOCATOR_SERIALIZE_NESTED_H @@ -100,12 +100,15 @@ class SerializeNested void write(::zserio::BitStreamWriter& out) const; + size_t bitPosition() const; + private: uint8_t readOffset(::zserio::BitStreamReader& in); ::zserio::InplaceOptionalHolder readOptionalValue(::zserio::BitStreamReader& in); int8_t m_param_; bool m_isInitialized; + size_t m_bitPosition; uint8_t m_offset_; ::zserio::InplaceOptionalHolder m_optionalValue_; }; diff --git a/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/SerializeObject.cpp b/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/SerializeObject.cpp index e6bb86f72..697808968 100644 --- a/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/SerializeObject.cpp +++ b/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/SerializeObject.cpp @@ -1,6 +1,6 @@ /** * Automatically generated by Zserio C++ generator version 1.0.2 using Zserio core 2.14.1. - * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, polymorphicAllocator. + * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, bitPosition, polymorphicAllocator. */ #include @@ -22,6 +22,7 @@ namespace polymorphic_allocator SerializeObject::SerializeObject(const allocator_type& allocator) noexcept : m_areChildrenInitialized(false), + m_bitPosition(0), m_param_(int8_t()), m_nested_(allocator) { @@ -29,12 +30,14 @@ SerializeObject::SerializeObject(const allocator_type& allocator) noexcept : SerializeObject::SerializeObject(::zserio::BitStreamReader& in, const allocator_type& allocator) : m_areChildrenInitialized(true), + m_bitPosition(in.getBitPosition()), m_param_(readParam(in)), m_nested_(readNested(in, allocator)) { } SerializeObject::SerializeObject(const SerializeObject& other) : + m_bitPosition(other.m_bitPosition), m_param_(other.m_param_), m_nested_(::zserio::NoInit, other.m_nested_) { @@ -50,6 +53,7 @@ SerializeObject::SerializeObject(const SerializeObject& other) : SerializeObject& SerializeObject::operator=(const SerializeObject& other) { + m_bitPosition = other.m_bitPosition; m_param_ = other.m_param_; (void)m_nested_.assign(::zserio::NoInit, other.m_nested_); if (other.m_areChildrenInitialized) @@ -65,6 +69,7 @@ SerializeObject& SerializeObject::operator=(const SerializeObject& other) } SerializeObject::SerializeObject(SerializeObject&& other) : + m_bitPosition(other.m_bitPosition), m_param_(::std::move(other.m_param_)), m_nested_(::zserio::NoInit, ::std::move(other.m_nested_)) { @@ -80,6 +85,7 @@ SerializeObject::SerializeObject(SerializeObject&& other) : SerializeObject& SerializeObject::operator=(SerializeObject&& other) { + m_bitPosition = other.m_bitPosition; m_param_ = ::std::move(other.m_param_); (void)m_nested_.assign(::zserio::NoInit, ::std::move(other.m_nested_)); if (other.m_areChildrenInitialized) @@ -96,6 +102,7 @@ SerializeObject& SerializeObject::operator=(SerializeObject&& other) SerializeObject::SerializeObject(::zserio::PropagateAllocatorT, const SerializeObject& other, const allocator_type& allocator) : + m_bitPosition(other.m_bitPosition), m_param_(::zserio::allocatorPropagatingCopy(other.m_param_, allocator)), m_nested_(::zserio::NoInit, ::zserio::allocatorPropagatingCopy(::zserio::NoInit, other.m_nested_, allocator)) { @@ -212,6 +219,11 @@ ::zserio::pmr::IReflectableConstPtr SerializeObject::reflectable(const allocator return ::zserio::pmr::AnyHolder(::std::cref(m_object), alloc); } + size_t bitPosition() const override + { + return m_object.bitPosition(); + } + private: const ::test_object::polymorphic_allocator::SerializeObject& m_object; }; @@ -316,6 +328,11 @@ ::zserio::pmr::IReflectablePtr SerializeObject::reflectable(const allocator_type return ::zserio::pmr::AnyHolder(::std::ref(m_object), alloc); } + size_t bitPosition() const override + { + return m_object.bitPosition(); + } + private: ::test_object::polymorphic_allocator::SerializeObject& m_object; }; @@ -438,6 +455,11 @@ void SerializeObject::write(::zserio::BitStreamWriter& out) const m_nested_.write(out); } +size_t SerializeObject::bitPosition() const +{ + return m_bitPosition; +} + int8_t SerializeObject::readParam(::zserio::BitStreamReader& in) { return static_cast(in.readSignedBits(UINT8_C(8))); diff --git a/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/SerializeObject.h b/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/SerializeObject.h index 4ddfac646..c27b306b8 100644 --- a/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/SerializeObject.h +++ b/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/SerializeObject.h @@ -1,6 +1,6 @@ /** * Automatically generated by Zserio C++ generator version 1.0.2 using Zserio core 2.14.1. - * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, polymorphicAllocator. + * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, bitPosition, polymorphicAllocator. */ #ifndef TEST_OBJECT_POLYMORPHIC_ALLOCATOR_SERIALIZE_OBJECT_H @@ -84,12 +84,15 @@ class SerializeObject void write(::zserio::BitStreamWriter& out) const; + size_t bitPosition() const; + private: int8_t readParam(::zserio::BitStreamReader& in); ::test_object::polymorphic_allocator::SerializeNested readNested(::zserio::BitStreamReader& in, const allocator_type& allocator); bool m_areChildrenInitialized; + size_t m_bitPosition; int8_t m_param_; ::test_object::polymorphic_allocator::SerializeNested m_nested_; }; diff --git a/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/WalkerBitmask.cpp b/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/WalkerBitmask.cpp index 88949781b..3e63d1806 100644 --- a/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/WalkerBitmask.cpp +++ b/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/WalkerBitmask.cpp @@ -1,6 +1,6 @@ /** * Automatically generated by Zserio C++ generator version 1.0.2 using Zserio core 2.14.1. - * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, polymorphicAllocator. + * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, bitPosition, polymorphicAllocator. */ #include diff --git a/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/WalkerBitmask.h b/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/WalkerBitmask.h index 71310e5cf..7329da6b0 100644 --- a/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/WalkerBitmask.h +++ b/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/WalkerBitmask.h @@ -1,6 +1,6 @@ /** * Automatically generated by Zserio C++ generator version 1.0.2 using Zserio core 2.14.1. - * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, polymorphicAllocator. + * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, bitPosition, polymorphicAllocator. */ #ifndef TEST_OBJECT_POLYMORPHIC_ALLOCATOR_WALKER_BITMASK_H diff --git a/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/WalkerChoice.cpp b/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/WalkerChoice.cpp index 1c9d32784..65965bb04 100644 --- a/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/WalkerChoice.cpp +++ b/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/WalkerChoice.cpp @@ -1,6 +1,6 @@ /** * Automatically generated by Zserio C++ generator version 1.0.2 using Zserio core 2.14.1. - * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, polymorphicAllocator. + * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, bitPosition, polymorphicAllocator. */ #include @@ -21,6 +21,7 @@ namespace polymorphic_allocator WalkerChoice::WalkerChoice(const allocator_type& allocator) noexcept : m_isInitialized(false), + m_bitPosition(0), m_objectChoice(allocator) { } @@ -29,11 +30,13 @@ WalkerChoice::WalkerChoice(::zserio::BitStreamReader& in, uint8_t selector_, const allocator_type& allocator) : m_selector_(selector_), m_isInitialized(true), + m_bitPosition(in.getBitPosition()), m_objectChoice(readObject(in, allocator), allocator) { } WalkerChoice::WalkerChoice(const WalkerChoice& other) : + m_bitPosition(other.m_bitPosition), m_objectChoice(::zserio::NoInit, other.m_objectChoice) { if (other.m_isInitialized) @@ -48,6 +51,7 @@ WalkerChoice::WalkerChoice(const WalkerChoice& other) : WalkerChoice& WalkerChoice::operator=(const WalkerChoice& other) { + m_bitPosition = other.m_bitPosition; (void)m_objectChoice.assign(::zserio::NoInit, other.m_objectChoice); if (other.m_isInitialized) { @@ -62,6 +66,7 @@ WalkerChoice& WalkerChoice::operator=(const WalkerChoice& other) } WalkerChoice::WalkerChoice(WalkerChoice&& other) : + m_bitPosition(other.m_bitPosition), m_objectChoice(::zserio::NoInit, ::std::move(other.m_objectChoice)) { if (other.m_isInitialized) @@ -76,6 +81,7 @@ WalkerChoice::WalkerChoice(WalkerChoice&& other) : WalkerChoice& WalkerChoice::operator=(WalkerChoice&& other) { + m_bitPosition = other.m_bitPosition; (void)m_objectChoice.assign(::zserio::NoInit, ::std::move(other.m_objectChoice)); if (other.m_isInitialized) { @@ -92,6 +98,7 @@ WalkerChoice& WalkerChoice::operator=(WalkerChoice&& other) WalkerChoice::WalkerChoice(::zserio::NoInitT, const WalkerChoice& other) : m_isInitialized(false), + m_bitPosition(other.m_bitPosition), m_objectChoice(::zserio::NoInit, other.m_objectChoice) { } @@ -100,6 +107,7 @@ WalkerChoice& WalkerChoice::assign(::zserio::NoInitT, const WalkerChoice& other) { m_isInitialized = false; + m_bitPosition = other.m_bitPosition; (void)m_objectChoice.assign(::zserio::NoInit, other.m_objectChoice); return *this; @@ -108,6 +116,7 @@ WalkerChoice& WalkerChoice::assign(::zserio::NoInitT, WalkerChoice::WalkerChoice(::zserio::NoInitT, WalkerChoice&& other) : m_isInitialized(false), + m_bitPosition(other.m_bitPosition), m_objectChoice(::zserio::NoInit, ::std::move(other.m_objectChoice)) { } @@ -116,6 +125,7 @@ WalkerChoice& WalkerChoice::assign(::zserio::NoInitT, WalkerChoice&& other) { m_isInitialized = false; + m_bitPosition = other.m_bitPosition; (void)m_objectChoice.assign(::zserio::NoInit, ::std::move(other.m_objectChoice)); return *this; @@ -123,6 +133,7 @@ WalkerChoice& WalkerChoice::assign(::zserio::NoInitT, WalkerChoice::WalkerChoice(::zserio::PropagateAllocatorT, const WalkerChoice& other, const allocator_type& allocator) : + m_bitPosition(other.m_bitPosition), m_objectChoice(::zserio::NoInit, other.copyObject(allocator)) { if (other.m_isInitialized) @@ -138,6 +149,7 @@ WalkerChoice::WalkerChoice(::zserio::PropagateAllocatorT, WalkerChoice::WalkerChoice(::zserio::PropagateAllocatorT, ::zserio::NoInitT, const WalkerChoice& other, const allocator_type& allocator) : m_isInitialized(false), + m_bitPosition(other.m_bitPosition), m_objectChoice(::zserio::NoInit, other.copyObject(allocator)) { } @@ -347,6 +359,11 @@ ::zserio::pmr::IReflectableConstPtr WalkerChoice::reflectable(const allocator_ty return ::zserio::pmr::AnyHolder(::std::cref(m_object), alloc); } + size_t bitPosition() const override + { + return m_object.bitPosition(); + } + private: const ::test_object::polymorphic_allocator::WalkerChoice& m_object; }; @@ -535,13 +552,17 @@ ::zserio::pmr::IReflectablePtr WalkerChoice::reflectable(const allocator_type& a return ::zserio::pmr::AnyHolder(::std::ref(m_object), alloc); } + size_t bitPosition() const override + { + return m_object.bitPosition(); + } + private: ::test_object::polymorphic_allocator::WalkerChoice& m_object; }; return std::allocate_shared(allocator, *this, allocator); } - void WalkerChoice::initialize( uint8_t selector_) { @@ -814,6 +835,11 @@ void WalkerChoice::write(::zserio::BitStreamWriter& out) const } } +size_t WalkerChoice::bitPosition() const +{ + return m_bitPosition; +} + ::zserio::pmr::AnyHolder WalkerChoice::readObject(::zserio::BitStreamReader& in, const allocator_type& allocator) { switch (getSelector()) diff --git a/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/WalkerChoice.h b/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/WalkerChoice.h index 09346f219..4319e9d83 100644 --- a/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/WalkerChoice.h +++ b/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/WalkerChoice.h @@ -1,6 +1,6 @@ /** * Automatically generated by Zserio C++ generator version 1.0.2 using Zserio core 2.14.1. - * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, polymorphicAllocator. + * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, bitPosition, polymorphicAllocator. */ #ifndef TEST_OBJECT_POLYMORPHIC_ALLOCATOR_WALKER_CHOICE_H @@ -103,12 +103,15 @@ class WalkerChoice void write(::zserio::BitStreamWriter& out) const; + size_t bitPosition() const; + private: ::zserio::pmr::AnyHolder readObject(::zserio::BitStreamReader& in, const allocator_type& allocator); ::zserio::pmr::AnyHolder copyObject(const allocator_type& allocator) const; uint8_t m_selector_; bool m_isInitialized; + size_t m_bitPosition; ::zserio::pmr::AnyHolder m_objectChoice; }; diff --git a/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/WalkerNested.cpp b/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/WalkerNested.cpp index e83e6bb73..bdb5482eb 100644 --- a/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/WalkerNested.cpp +++ b/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/WalkerNested.cpp @@ -1,6 +1,6 @@ /** * Automatically generated by Zserio C++ generator version 1.0.2 using Zserio core 2.14.1. - * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, polymorphicAllocator. + * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, bitPosition, polymorphicAllocator. */ #include @@ -21,17 +21,20 @@ namespace polymorphic_allocator { WalkerNested::WalkerNested(const allocator_type& allocator) noexcept : + m_bitPosition(0), m_text_(allocator) { } WalkerNested::WalkerNested(::zserio::BitStreamReader& in, const allocator_type& allocator) : + m_bitPosition(in.getBitPosition()), m_text_(readText(in, allocator)) { } WalkerNested::WalkerNested(::zserio::PropagateAllocatorT, const WalkerNested& other, const allocator_type& allocator) : + m_bitPosition(other.m_bitPosition), m_text_(::zserio::allocatorPropagatingCopy(other.m_text_, allocator)) { } @@ -116,6 +119,11 @@ ::zserio::pmr::IReflectableConstPtr WalkerNested::reflectable(const allocator_ty return ::zserio::pmr::AnyHolder(::std::cref(m_object), alloc); } + size_t bitPosition() const override + { + return m_object.bitPosition(); + } + private: const ::test_object::polymorphic_allocator::WalkerNested& m_object; }; @@ -201,6 +209,11 @@ ::zserio::pmr::IReflectablePtr WalkerNested::reflectable(const allocator_type& a return ::zserio::pmr::AnyHolder(::std::ref(m_object), alloc); } + size_t bitPosition() const override + { + return m_object.bitPosition(); + } + private: ::test_object::polymorphic_allocator::WalkerNested& m_object; }; @@ -285,6 +298,11 @@ void WalkerNested::write(::zserio::BitStreamWriter& out) const out.writeString(m_text_); } +size_t WalkerNested::bitPosition() const +{ + return m_bitPosition; +} + ::zserio::pmr::string WalkerNested::readText(::zserio::BitStreamReader& in, const allocator_type& allocator) { diff --git a/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/WalkerNested.h b/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/WalkerNested.h index 24cdb5579..0e169f1c0 100644 --- a/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/WalkerNested.h +++ b/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/WalkerNested.h @@ -1,6 +1,6 @@ /** * Automatically generated by Zserio C++ generator version 1.0.2 using Zserio core 2.14.1. - * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, polymorphicAllocator. + * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, bitPosition, polymorphicAllocator. */ #ifndef TEST_OBJECT_POLYMORPHIC_ALLOCATOR_WALKER_NESTED_H @@ -76,10 +76,13 @@ class WalkerNested void write(::zserio::BitStreamWriter& out) const; + size_t bitPosition() const; + private: ::zserio::pmr::string readText(::zserio::BitStreamReader& in, const allocator_type& allocator); + size_t m_bitPosition; ::zserio::pmr::string m_text_; }; diff --git a/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/WalkerObject.cpp b/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/WalkerObject.cpp index bfdfe09a1..e37de62ed 100644 --- a/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/WalkerObject.cpp +++ b/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/WalkerObject.cpp @@ -1,6 +1,6 @@ /** * Automatically generated by Zserio C++ generator version 1.0.2 using Zserio core 2.14.1. - * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, polymorphicAllocator. + * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, bitPosition, polymorphicAllocator. */ #include @@ -22,6 +22,7 @@ namespace polymorphic_allocator WalkerObject::WalkerObject(const allocator_type& allocator) noexcept : m_areChildrenInitialized(false), + m_bitPosition(0), m_identifier_(uint32_t()), m_nested_(::zserio::NullOpt), m_text_(allocator), @@ -34,6 +35,7 @@ WalkerObject::WalkerObject(const allocator_type& allocator) noexcept : WalkerObject::WalkerObject(::zserio::BitStreamReader& in, const allocator_type& allocator) : m_areChildrenInitialized(true), + m_bitPosition(in.getBitPosition()), m_identifier_(readIdentifier(in)), m_nested_(readNested(in, allocator)), m_text_(readText(in, allocator)), @@ -45,6 +47,7 @@ WalkerObject::WalkerObject(::zserio::BitStreamReader& in, const allocator_type& } WalkerObject::WalkerObject(const WalkerObject& other) : + m_bitPosition(other.m_bitPosition), m_identifier_(other.m_identifier_), m_nested_(other.m_nested_), m_text_(other.m_text_), @@ -65,6 +68,7 @@ WalkerObject::WalkerObject(const WalkerObject& other) : WalkerObject& WalkerObject::operator=(const WalkerObject& other) { + m_bitPosition = other.m_bitPosition; m_identifier_ = other.m_identifier_; m_nested_ = other.m_nested_; m_text_ = other.m_text_; @@ -85,6 +89,7 @@ WalkerObject& WalkerObject::operator=(const WalkerObject& other) } WalkerObject::WalkerObject(WalkerObject&& other) : + m_bitPosition(other.m_bitPosition), m_identifier_(::std::move(other.m_identifier_)), m_nested_(::std::move(other.m_nested_)), m_text_(::std::move(other.m_text_)), @@ -105,6 +110,7 @@ WalkerObject::WalkerObject(WalkerObject&& other) : WalkerObject& WalkerObject::operator=(WalkerObject&& other) { + m_bitPosition = other.m_bitPosition; m_identifier_ = ::std::move(other.m_identifier_); m_nested_ = ::std::move(other.m_nested_); m_text_ = ::std::move(other.m_text_); @@ -126,6 +132,7 @@ WalkerObject& WalkerObject::operator=(WalkerObject&& other) WalkerObject::WalkerObject(::zserio::PropagateAllocatorT, const WalkerObject& other, const allocator_type& allocator) : + m_bitPosition(other.m_bitPosition), m_identifier_(::zserio::allocatorPropagatingCopy(other.m_identifier_, allocator)), m_nested_(::zserio::allocatorPropagatingCopy(other.m_nested_, allocator)), m_text_(::zserio::allocatorPropagatingCopy(other.m_text_, allocator)), @@ -357,6 +364,11 @@ ::zserio::pmr::IReflectableConstPtr WalkerObject::reflectable(const allocator_ty return ::zserio::pmr::AnyHolder(::std::cref(m_object), alloc); } + size_t bitPosition() const override + { + return m_object.bitPosition(); + } + private: const ::test_object::polymorphic_allocator::WalkerObject& m_object; }; @@ -583,6 +595,11 @@ ::zserio::pmr::IReflectablePtr WalkerObject::reflectable(const allocator_type& a return ::zserio::pmr::AnyHolder(::std::ref(m_object), alloc); } + size_t bitPosition() const override + { + return m_object.bitPosition(); + } + private: ::test_object::polymorphic_allocator::WalkerObject& m_object; }; @@ -704,7 +721,7 @@ void WalkerObject::setOptionalUnionArray(::zserio::pmr::vector<::test_object::po bool WalkerObject::isOptionalUnionArrayUsed() const { - return (isOptionalUnionArraySet()); + return (m_optionalUnionArray_.hasValue()); } bool WalkerObject::isOptionalUnionArraySet() const @@ -759,7 +776,7 @@ size_t WalkerObject::bitSizeOf(size_t bitPosition) const endBitPosition += ::zserio::bitSizeOfString(m_text_); endBitPosition += m_unionArray_.bitSizeOf(*this, endBitPosition); endBitPosition += 1; - if (isOptionalUnionArraySet()) + if (m_optionalUnionArray_.hasValue()) { endBitPosition += m_optionalUnionArray_.value().bitSizeOf(*this, endBitPosition); } @@ -781,7 +798,7 @@ size_t WalkerObject::initializeOffsets(size_t bitPosition) endBitPosition += ::zserio::bitSizeOfString(m_text_); endBitPosition = m_unionArray_.initializeOffsets(*this, endBitPosition); endBitPosition += 1; - if (isOptionalUnionArraySet()) + if (m_optionalUnionArray_.hasValue()) { endBitPosition = m_optionalUnionArray_.value().initializeOffsets(*this, endBitPosition); } @@ -924,7 +941,7 @@ void WalkerObject::write(::zserio::BitStreamWriter& out) const m_unionArray_.write(*this, out); - if (isOptionalUnionArraySet()) + if (m_optionalUnionArray_.hasValue()) { out.writeBool(true); m_optionalUnionArray_.value().write(*this, out); @@ -945,6 +962,11 @@ void WalkerObject::write(::zserio::BitStreamWriter& out) const m_choiceField_.write(out); } +size_t WalkerObject::bitPosition() const +{ + return m_bitPosition; +} + void WalkerObject::ZserioElementFactory_unionArray::create(WalkerObject&, ::zserio::pmr::vector<::test_object::polymorphic_allocator::WalkerUnion>& array, ::zserio::BitStreamReader& in, size_t) diff --git a/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/WalkerObject.h b/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/WalkerObject.h index 7b3b3cea1..e11707920 100644 --- a/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/WalkerObject.h +++ b/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/WalkerObject.h @@ -1,6 +1,6 @@ /** * Automatically generated by Zserio C++ generator version 1.0.2 using Zserio core 2.14.1. - * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, polymorphicAllocator. + * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, bitPosition, polymorphicAllocator. */ #ifndef TEST_OBJECT_POLYMORPHIC_ALLOCATOR_WALKER_OBJECT_H @@ -134,6 +134,8 @@ class WalkerObject void write(::zserio::BitStreamWriter& out) const; + size_t bitPosition() const; + private: class ZserioElementFactory_unionArray { @@ -172,6 +174,7 @@ class WalkerObject const allocator_type& allocator); bool m_areChildrenInitialized; + size_t m_bitPosition; uint32_t m_identifier_; ::zserio::InplaceOptionalHolder<::test_object::polymorphic_allocator::WalkerNested> m_nested_; ::zserio::pmr::string m_text_; diff --git a/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/WalkerUnion.cpp b/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/WalkerUnion.cpp index 4ba157553..de45ca3f7 100644 --- a/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/WalkerUnion.cpp +++ b/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/WalkerUnion.cpp @@ -1,6 +1,6 @@ /** * Automatically generated by Zserio C++ generator version 1.0.2 using Zserio core 2.14.1. - * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, polymorphicAllocator. + * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, bitPosition, polymorphicAllocator. */ #include @@ -20,12 +20,14 @@ namespace polymorphic_allocator { WalkerUnion::WalkerUnion(const allocator_type& allocator) noexcept : + m_bitPosition(0), m_choiceTag(UNDEFINED_CHOICE), m_objectChoice(allocator) { } WalkerUnion::WalkerUnion(::zserio::BitStreamReader& in, const allocator_type& allocator) : + m_bitPosition(in.getBitPosition()), m_choiceTag(readChoiceTag(in)), m_objectChoice(readObject(in, allocator)) { @@ -33,6 +35,7 @@ WalkerUnion::WalkerUnion(::zserio::BitStreamReader& in, const allocator_type& al WalkerUnion::WalkerUnion(::zserio::PropagateAllocatorT, const WalkerUnion& other, const allocator_type& allocator) : + m_bitPosition(other.m_bitPosition), m_choiceTag(other.m_choiceTag), m_objectChoice(::zserio::NoInit, other.copyObject(allocator)) { @@ -173,6 +176,11 @@ ::zserio::pmr::IReflectableConstPtr WalkerUnion::reflectable(const allocator_typ return ::zserio::pmr::AnyHolder(::std::cref(m_object), alloc); } + size_t bitPosition() const override + { + return m_object.bitPosition(); + } + private: const ::test_object::polymorphic_allocator::WalkerUnion& m_object; }; @@ -309,6 +317,11 @@ ::zserio::pmr::IReflectablePtr WalkerUnion::reflectable(const allocator_type& al return ::zserio::pmr::AnyHolder(::std::ref(m_object), alloc); } + size_t bitPosition() const override + { + return m_object.bitPosition(); + } + private: ::test_object::polymorphic_allocator::WalkerUnion& m_object; }; @@ -551,6 +564,11 @@ void WalkerUnion::write(::zserio::BitStreamWriter& out) const } } +size_t WalkerUnion::bitPosition() const +{ + return m_bitPosition; +} + void WalkerUnion::ZserioElementFactory_nestedArray::create(WalkerUnion&, ::zserio::pmr::vector<::test_object::polymorphic_allocator::WalkerNested>& array, ::zserio::BitStreamReader& in, size_t) diff --git a/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/WalkerUnion.h b/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/WalkerUnion.h index 9fefeee35..6ced90b83 100644 --- a/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/WalkerUnion.h +++ b/compiler/extensions/cpp/runtime/test/test_object/polymorphic_allocator/WalkerUnion.h @@ -1,6 +1,6 @@ /** * Automatically generated by Zserio C++ generator version 1.0.2 using Zserio core 2.14.1. - * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, polymorphicAllocator. + * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, bitPosition, polymorphicAllocator. */ #ifndef TEST_OBJECT_POLYMORPHIC_ALLOCATOR_WALKER_UNION_H @@ -91,6 +91,8 @@ class WalkerUnion void write(::zserio::BitStreamWriter& out) const; + size_t bitPosition() const; + private: class ZserioElementFactory_nestedArray { @@ -108,6 +110,7 @@ class WalkerUnion ::zserio::pmr::AnyHolder readObject(::zserio::BitStreamReader& in, const allocator_type& allocator); ::zserio::pmr::AnyHolder copyObject(const allocator_type& allocator) const; + size_t m_bitPosition; ChoiceTag m_choiceTag; ::zserio::pmr::AnyHolder m_objectChoice; }; diff --git a/compiler/extensions/cpp/runtime/test/test_object/std_allocator/ArrayBitmask.cpp b/compiler/extensions/cpp/runtime/test/test_object/std_allocator/ArrayBitmask.cpp index 7780bbcaa..2fe80fcbf 100644 --- a/compiler/extensions/cpp/runtime/test/test_object/std_allocator/ArrayBitmask.cpp +++ b/compiler/extensions/cpp/runtime/test/test_object/std_allocator/ArrayBitmask.cpp @@ -1,6 +1,6 @@ /** * Automatically generated by Zserio C++ generator version 1.0.2 using Zserio core 2.14.1. - * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, stdAllocator. + * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, bitPosition, stdAllocator. */ #include diff --git a/compiler/extensions/cpp/runtime/test/test_object/std_allocator/ArrayBitmask.h b/compiler/extensions/cpp/runtime/test/test_object/std_allocator/ArrayBitmask.h index ac6cb4196..4bb5d241d 100644 --- a/compiler/extensions/cpp/runtime/test/test_object/std_allocator/ArrayBitmask.h +++ b/compiler/extensions/cpp/runtime/test/test_object/std_allocator/ArrayBitmask.h @@ -1,6 +1,6 @@ /** * Automatically generated by Zserio C++ generator version 1.0.2 using Zserio core 2.14.1. - * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, stdAllocator. + * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, bitPosition, stdAllocator. */ #ifndef TEST_OBJECT_STD_ALLOCATOR_ARRAY_BITMASK_H diff --git a/compiler/extensions/cpp/runtime/test/test_object/std_allocator/ArrayEnum.cpp b/compiler/extensions/cpp/runtime/test/test_object/std_allocator/ArrayEnum.cpp index 46192cd59..e58e4da3b 100644 --- a/compiler/extensions/cpp/runtime/test/test_object/std_allocator/ArrayEnum.cpp +++ b/compiler/extensions/cpp/runtime/test/test_object/std_allocator/ArrayEnum.cpp @@ -1,6 +1,6 @@ /** * Automatically generated by Zserio C++ generator version 1.0.2 using Zserio core 2.14.1. - * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, stdAllocator. + * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, bitPosition, stdAllocator. */ #include diff --git a/compiler/extensions/cpp/runtime/test/test_object/std_allocator/ArrayEnum.h b/compiler/extensions/cpp/runtime/test/test_object/std_allocator/ArrayEnum.h index ee2b9bfc4..01e940f2b 100644 --- a/compiler/extensions/cpp/runtime/test/test_object/std_allocator/ArrayEnum.h +++ b/compiler/extensions/cpp/runtime/test/test_object/std_allocator/ArrayEnum.h @@ -1,6 +1,6 @@ /** * Automatically generated by Zserio C++ generator version 1.0.2 using Zserio core 2.14.1. - * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, stdAllocator. + * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, bitPosition, stdAllocator. */ #ifndef TEST_OBJECT_STD_ALLOCATOR_ARRAY_ENUM_H diff --git a/compiler/extensions/cpp/runtime/test/test_object/std_allocator/ArrayHolder.cpp b/compiler/extensions/cpp/runtime/test/test_object/std_allocator/ArrayHolder.cpp index 5f699d63c..402f1145e 100644 --- a/compiler/extensions/cpp/runtime/test/test_object/std_allocator/ArrayHolder.cpp +++ b/compiler/extensions/cpp/runtime/test/test_object/std_allocator/ArrayHolder.cpp @@ -1,6 +1,6 @@ /** * Automatically generated by Zserio C++ generator version 1.0.2 using Zserio core 2.14.1. - * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, stdAllocator. + * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, bitPosition, stdAllocator. */ #include @@ -22,6 +22,7 @@ namespace std_allocator ArrayHolder::ArrayHolder(const allocator_type& allocator) noexcept : m_areChildrenInitialized(false), + m_bitPosition(0), m_enumArray_(allocator), m_bitmaskArray_(allocator), m_packedArray_(allocator), @@ -31,6 +32,7 @@ ArrayHolder::ArrayHolder(const allocator_type& allocator) noexcept : ArrayHolder::ArrayHolder(::zserio::BitStreamReader& in, const allocator_type& allocator) : m_areChildrenInitialized(true), + m_bitPosition(in.getBitPosition()), m_enumArray_(readEnumArray(in, allocator)), m_bitmaskArray_(readBitmaskArray(in, allocator)), m_packedArray_(readPackedArray(in, allocator)), @@ -39,6 +41,7 @@ ArrayHolder::ArrayHolder(::zserio::BitStreamReader& in, const allocator_type& al } ArrayHolder::ArrayHolder(const ArrayHolder& other) : + m_bitPosition(other.m_bitPosition), m_enumArray_(other.m_enumArray_), m_bitmaskArray_(other.m_bitmaskArray_), m_packedArray_(other.m_packedArray_), @@ -56,6 +59,7 @@ ArrayHolder::ArrayHolder(const ArrayHolder& other) : ArrayHolder& ArrayHolder::operator=(const ArrayHolder& other) { + m_bitPosition = other.m_bitPosition; m_enumArray_ = other.m_enumArray_; m_bitmaskArray_ = other.m_bitmaskArray_; m_packedArray_ = other.m_packedArray_; @@ -73,6 +77,7 @@ ArrayHolder& ArrayHolder::operator=(const ArrayHolder& other) } ArrayHolder::ArrayHolder(ArrayHolder&& other) : + m_bitPosition(other.m_bitPosition), m_enumArray_(::std::move(other.m_enumArray_)), m_bitmaskArray_(::std::move(other.m_bitmaskArray_)), m_packedArray_(::std::move(other.m_packedArray_)), @@ -90,6 +95,7 @@ ArrayHolder::ArrayHolder(ArrayHolder&& other) : ArrayHolder& ArrayHolder::operator=(ArrayHolder&& other) { + m_bitPosition = other.m_bitPosition; m_enumArray_ = ::std::move(other.m_enumArray_); m_bitmaskArray_ = ::std::move(other.m_bitmaskArray_); m_packedArray_ = ::std::move(other.m_packedArray_); @@ -108,6 +114,7 @@ ArrayHolder& ArrayHolder::operator=(ArrayHolder&& other) ArrayHolder::ArrayHolder(::zserio::PropagateAllocatorT, const ArrayHolder& other, const allocator_type& allocator) : + m_bitPosition(other.m_bitPosition), m_enumArray_(::zserio::allocatorPropagatingCopy(other.m_enumArray_, allocator)), m_bitmaskArray_(::zserio::allocatorPropagatingCopy(other.m_bitmaskArray_, allocator)), m_packedArray_(::zserio::allocatorPropagatingCopy(other.m_packedArray_, allocator)), @@ -266,6 +273,11 @@ ::zserio::IReflectableConstPtr ArrayHolder::reflectable(const allocator_type& al return ::zserio::AnyHolder<>(::std::cref(m_object), alloc); } + size_t bitPosition() const override + { + return m_object.bitPosition(); + } + private: const ::test_object::std_allocator::ArrayHolder& m_object; }; @@ -406,6 +418,11 @@ ::zserio::IReflectablePtr ArrayHolder::reflectable(const allocator_type& allocat return ::zserio::AnyHolder<>(::std::ref(m_object), alloc); } + size_t bitPosition() const override + { + return m_object.bitPosition(); + } + private: ::test_object::std_allocator::ArrayHolder& m_object; }; @@ -599,6 +616,11 @@ void ArrayHolder::write(::zserio::BitStreamWriter& out) const m_packedParamArray_.writePacked(*this, out); } +size_t ArrayHolder::bitPosition() const +{ + return m_bitPosition; +} + void ArrayHolder::ZserioElementFactory_packedArray::create(ArrayHolder&, ::zserio::vector<::test_object::std_allocator::ArrayObject>& array, ::zserio::BitStreamReader& in, size_t) diff --git a/compiler/extensions/cpp/runtime/test/test_object/std_allocator/ArrayHolder.h b/compiler/extensions/cpp/runtime/test/test_object/std_allocator/ArrayHolder.h index 9bf4208ac..c028b1848 100644 --- a/compiler/extensions/cpp/runtime/test/test_object/std_allocator/ArrayHolder.h +++ b/compiler/extensions/cpp/runtime/test/test_object/std_allocator/ArrayHolder.h @@ -1,6 +1,6 @@ /** * Automatically generated by Zserio C++ generator version 1.0.2 using Zserio core 2.14.1. - * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, stdAllocator. + * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, bitPosition, stdAllocator. */ #ifndef TEST_OBJECT_STD_ALLOCATOR_ARRAY_HOLDER_H @@ -108,6 +108,8 @@ class ArrayHolder void write(::zserio::BitStreamWriter& out) const; + size_t bitPosition() const; + private: class ZserioElementFactory_packedArray { @@ -163,6 +165,7 @@ class ArrayHolder const allocator_type& allocator); bool m_areChildrenInitialized; + size_t m_bitPosition; ZserioArrayType_enumArray m_enumArray_; ZserioArrayType_bitmaskArray m_bitmaskArray_; ZserioArrayType_packedArray m_packedArray_; diff --git a/compiler/extensions/cpp/runtime/test/test_object/std_allocator/ArrayObject.cpp b/compiler/extensions/cpp/runtime/test/test_object/std_allocator/ArrayObject.cpp index 0fa58d767..a4f757d91 100644 --- a/compiler/extensions/cpp/runtime/test/test_object/std_allocator/ArrayObject.cpp +++ b/compiler/extensions/cpp/runtime/test/test_object/std_allocator/ArrayObject.cpp @@ -1,6 +1,6 @@ /** * Automatically generated by Zserio C++ generator version 1.0.2 using Zserio core 2.14.1. - * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, stdAllocator. + * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, bitPosition, stdAllocator. */ #include @@ -21,22 +21,26 @@ namespace std_allocator { ArrayObject::ArrayObject(const allocator_type&) noexcept : + m_bitPosition(0), m_value_(uint32_t()) { } ArrayObject::ArrayObject(::zserio::BitStreamReader& in, const allocator_type&) : + m_bitPosition(in.getBitPosition()), m_value_(readValue(in)) { } ArrayObject::ArrayObject(ArrayObject::ZserioPackingContext& context, ::zserio::BitStreamReader& in, const allocator_type&) : + m_bitPosition(in.getBitPosition()), m_value_(readValue(context, in)) { } ArrayObject::ArrayObject(::zserio::PropagateAllocatorT, const ArrayObject& other, const allocator_type& allocator) : + m_bitPosition(other.m_bitPosition), m_value_(::zserio::allocatorPropagatingCopy(other.m_value_, allocator)) { } @@ -121,6 +125,11 @@ ::zserio::IReflectableConstPtr ArrayObject::reflectable(const allocator_type& al return ::zserio::AnyHolder<>(::std::cref(m_object), alloc); } + size_t bitPosition() const override + { + return m_object.bitPosition(); + } + private: const ::test_object::std_allocator::ArrayObject& m_object; }; @@ -206,6 +215,11 @@ ::zserio::IReflectablePtr ArrayObject::reflectable(const allocator_type& allocat return ::zserio::AnyHolder<>(::std::ref(m_object), alloc); } + size_t bitPosition() const override + { + return m_object.bitPosition(); + } + private: ::test_object::std_allocator::ArrayObject& m_object; }; @@ -308,6 +322,11 @@ void ArrayObject::write(ArrayObject::ZserioPackingContext& context, ::zserio::Bi context.getValue().write<::zserio::BitFieldArrayTraits>(out, m_value_); } +size_t ArrayObject::bitPosition() const +{ + return m_bitPosition; +} + uint32_t ArrayObject::readValue(::zserio::BitStreamReader& in) { return static_cast(in.readBits(UINT8_C(31))); diff --git a/compiler/extensions/cpp/runtime/test/test_object/std_allocator/ArrayObject.h b/compiler/extensions/cpp/runtime/test/test_object/std_allocator/ArrayObject.h index 19b074894..ef6e6c096 100644 --- a/compiler/extensions/cpp/runtime/test/test_object/std_allocator/ArrayObject.h +++ b/compiler/extensions/cpp/runtime/test/test_object/std_allocator/ArrayObject.h @@ -1,6 +1,6 @@ /** * Automatically generated by Zserio C++ generator version 1.0.2 using Zserio core 2.14.1. - * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, stdAllocator. + * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, bitPosition, stdAllocator. */ #ifndef TEST_OBJECT_STD_ALLOCATOR_ARRAY_OBJECT_H @@ -92,11 +92,14 @@ class ArrayObject void write(::zserio::BitStreamWriter& out) const; void write(ZserioPackingContext& context, ::zserio::BitStreamWriter& out) const; + size_t bitPosition() const; + private: uint32_t readValue(::zserio::BitStreamReader& in); uint32_t readValue(ZserioPackingContext& context, ::zserio::BitStreamReader& in); + size_t m_bitPosition; uint32_t m_value_; }; diff --git a/compiler/extensions/cpp/runtime/test/test_object/std_allocator/ArrayParamObject.cpp b/compiler/extensions/cpp/runtime/test/test_object/std_allocator/ArrayParamObject.cpp index 40914e50d..1ca332732 100644 --- a/compiler/extensions/cpp/runtime/test/test_object/std_allocator/ArrayParamObject.cpp +++ b/compiler/extensions/cpp/runtime/test/test_object/std_allocator/ArrayParamObject.cpp @@ -1,6 +1,6 @@ /** * Automatically generated by Zserio C++ generator version 1.0.2 using Zserio core 2.14.1. - * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, stdAllocator. + * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, bitPosition, stdAllocator. */ #include @@ -24,6 +24,7 @@ namespace std_allocator ArrayParamObject::ArrayParamObject(const allocator_type&) noexcept : m_isInitialized(false), + m_bitPosition(0), m_value_(uint32_t()) { } @@ -32,6 +33,7 @@ ArrayParamObject::ArrayParamObject(::zserio::BitStreamReader& in, ::test_object::std_allocator::ArrayObject& param_, const allocator_type&) : m_param_(¶m_), m_isInitialized(true), + m_bitPosition(in.getBitPosition()), m_value_(readValue(in)) { } @@ -40,11 +42,13 @@ ArrayParamObject::ArrayParamObject(ArrayParamObject::ZserioPackingContext& conte ::test_object::std_allocator::ArrayObject& param_, const allocator_type&) : m_param_(¶m_), m_isInitialized(true), + m_bitPosition(in.getBitPosition()), m_value_(readValue(context, in)) { } ArrayParamObject::ArrayParamObject(const ArrayParamObject& other) : + m_bitPosition(other.m_bitPosition), m_value_(other.m_value_) { if (other.m_isInitialized) @@ -59,6 +63,7 @@ ArrayParamObject::ArrayParamObject(const ArrayParamObject& other) : ArrayParamObject& ArrayParamObject::operator=(const ArrayParamObject& other) { + m_bitPosition = other.m_bitPosition; m_value_ = other.m_value_; if (other.m_isInitialized) { @@ -73,6 +78,7 @@ ArrayParamObject& ArrayParamObject::operator=(const ArrayParamObject& other) } ArrayParamObject::ArrayParamObject(ArrayParamObject&& other) : + m_bitPosition(other.m_bitPosition), m_value_(::std::move(other.m_value_)) { if (other.m_isInitialized) @@ -87,6 +93,7 @@ ArrayParamObject::ArrayParamObject(ArrayParamObject&& other) : ArrayParamObject& ArrayParamObject::operator=(ArrayParamObject&& other) { + m_bitPosition = other.m_bitPosition; m_value_ = ::std::move(other.m_value_); if (other.m_isInitialized) { @@ -103,6 +110,7 @@ ArrayParamObject& ArrayParamObject::operator=(ArrayParamObject&& other) ArrayParamObject::ArrayParamObject(::zserio::NoInitT, const ArrayParamObject& other) : m_isInitialized(false), + m_bitPosition(other.m_bitPosition), m_value_(other.m_value_) { } @@ -111,6 +119,7 @@ ArrayParamObject& ArrayParamObject::assign(::zserio::NoInitT, const ArrayParamObject& other) { m_isInitialized = false; + m_bitPosition = other.m_bitPosition; m_value_ = other.m_value_; return *this; @@ -119,6 +128,7 @@ ArrayParamObject& ArrayParamObject::assign(::zserio::NoInitT, ArrayParamObject::ArrayParamObject(::zserio::NoInitT, ArrayParamObject&& other) : m_isInitialized(false), + m_bitPosition(other.m_bitPosition), m_value_(::std::move(other.m_value_)) { } @@ -127,6 +137,7 @@ ArrayParamObject& ArrayParamObject::assign(::zserio::NoInitT, ArrayParamObject&& other) { m_isInitialized = false; + m_bitPosition = other.m_bitPosition; m_value_ = ::std::move(other.m_value_); return *this; @@ -134,6 +145,7 @@ ArrayParamObject& ArrayParamObject::assign(::zserio::NoInitT, ArrayParamObject::ArrayParamObject(::zserio::PropagateAllocatorT, const ArrayParamObject& other, const allocator_type& allocator) : + m_bitPosition(other.m_bitPosition), m_value_(::zserio::allocatorPropagatingCopy(other.m_value_, allocator)) { if (other.m_isInitialized) @@ -149,6 +161,7 @@ ArrayParamObject::ArrayParamObject(::zserio::PropagateAllocatorT, ArrayParamObject::ArrayParamObject(::zserio::PropagateAllocatorT, ::zserio::NoInitT, const ArrayParamObject& other, const allocator_type& allocator) : m_isInitialized(false), + m_bitPosition(other.m_bitPosition), m_value_(::zserio::allocatorPropagatingCopy(other.m_value_, allocator)) { } @@ -247,6 +260,11 @@ ::zserio::IReflectableConstPtr ArrayParamObject::reflectable(const allocator_typ return ::zserio::AnyHolder<>(::std::cref(m_object), alloc); } + size_t bitPosition() const override + { + return m_object.bitPosition(); + } + private: const ::test_object::std_allocator::ArrayParamObject& m_object; }; @@ -364,6 +382,11 @@ ::zserio::IReflectablePtr ArrayParamObject::reflectable(const allocator_type& al return ::zserio::AnyHolder<>(::std::ref(m_object), alloc); } + size_t bitPosition() const override + { + return m_object.bitPosition(); + } + private: ::test_object::std_allocator::ArrayParamObject& m_object; }; @@ -519,6 +542,11 @@ void ArrayParamObject::write(ArrayParamObject::ZserioPackingContext& context, :: context.getValue().write<::zserio::StdIntArrayTraits>(out, m_value_); } +size_t ArrayParamObject::bitPosition() const +{ + return m_bitPosition; +} + uint32_t ArrayParamObject::readValue(::zserio::BitStreamReader& in) { uint32_t readField = static_cast(in.readBits(UINT8_C(32))); diff --git a/compiler/extensions/cpp/runtime/test/test_object/std_allocator/ArrayParamObject.h b/compiler/extensions/cpp/runtime/test/test_object/std_allocator/ArrayParamObject.h index 76c16cfdc..067058309 100644 --- a/compiler/extensions/cpp/runtime/test/test_object/std_allocator/ArrayParamObject.h +++ b/compiler/extensions/cpp/runtime/test/test_object/std_allocator/ArrayParamObject.h @@ -1,6 +1,6 @@ /** * Automatically generated by Zserio C++ generator version 1.0.2 using Zserio core 2.14.1. - * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, stdAllocator. + * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, bitPosition, stdAllocator. */ #ifndef TEST_OBJECT_STD_ALLOCATOR_ARRAY_PARAM_OBJECT_H @@ -114,6 +114,8 @@ class ArrayParamObject void write(::zserio::BitStreamWriter& out) const; void write(ZserioPackingContext& context, ::zserio::BitStreamWriter& out) const; + size_t bitPosition() const; + private: uint32_t readValue(::zserio::BitStreamReader& in); uint32_t readValue(ZserioPackingContext& context, @@ -121,6 +123,7 @@ class ArrayParamObject ::test_object::std_allocator::ArrayObject* m_param_; bool m_isInitialized; + size_t m_bitPosition; uint32_t m_value_; }; diff --git a/compiler/extensions/cpp/runtime/test/test_object/std_allocator/CreatorBitmask.cpp b/compiler/extensions/cpp/runtime/test/test_object/std_allocator/CreatorBitmask.cpp index 70468a557..60104db5e 100644 --- a/compiler/extensions/cpp/runtime/test/test_object/std_allocator/CreatorBitmask.cpp +++ b/compiler/extensions/cpp/runtime/test/test_object/std_allocator/CreatorBitmask.cpp @@ -1,6 +1,6 @@ /** * Automatically generated by Zserio C++ generator version 1.0.2 using Zserio core 2.14.1. - * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, stdAllocator. + * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, bitPosition, stdAllocator. */ #include diff --git a/compiler/extensions/cpp/runtime/test/test_object/std_allocator/CreatorBitmask.h b/compiler/extensions/cpp/runtime/test/test_object/std_allocator/CreatorBitmask.h index af266be20..033e5c93d 100644 --- a/compiler/extensions/cpp/runtime/test/test_object/std_allocator/CreatorBitmask.h +++ b/compiler/extensions/cpp/runtime/test/test_object/std_allocator/CreatorBitmask.h @@ -1,6 +1,6 @@ /** * Automatically generated by Zserio C++ generator version 1.0.2 using Zserio core 2.14.1. - * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, stdAllocator. + * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, bitPosition, stdAllocator. */ #ifndef TEST_OBJECT_STD_ALLOCATOR_CREATOR_BITMASK_H diff --git a/compiler/extensions/cpp/runtime/test/test_object/std_allocator/CreatorEnum.cpp b/compiler/extensions/cpp/runtime/test/test_object/std_allocator/CreatorEnum.cpp index 399ca0648..f2b7ef4af 100644 --- a/compiler/extensions/cpp/runtime/test/test_object/std_allocator/CreatorEnum.cpp +++ b/compiler/extensions/cpp/runtime/test/test_object/std_allocator/CreatorEnum.cpp @@ -1,6 +1,6 @@ /** * Automatically generated by Zserio C++ generator version 1.0.2 using Zserio core 2.14.1. - * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, stdAllocator. + * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, bitPosition, stdAllocator. */ #include diff --git a/compiler/extensions/cpp/runtime/test/test_object/std_allocator/CreatorEnum.h b/compiler/extensions/cpp/runtime/test/test_object/std_allocator/CreatorEnum.h index 2cd189d8f..ce0466e80 100644 --- a/compiler/extensions/cpp/runtime/test/test_object/std_allocator/CreatorEnum.h +++ b/compiler/extensions/cpp/runtime/test/test_object/std_allocator/CreatorEnum.h @@ -1,6 +1,6 @@ /** * Automatically generated by Zserio C++ generator version 1.0.2 using Zserio core 2.14.1. - * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, stdAllocator. + * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, bitPosition, stdAllocator. */ #ifndef TEST_OBJECT_STD_ALLOCATOR_CREATOR_ENUM_H diff --git a/compiler/extensions/cpp/runtime/test/test_object/std_allocator/CreatorNested.cpp b/compiler/extensions/cpp/runtime/test/test_object/std_allocator/CreatorNested.cpp index fa89f6e09..c25deedee 100644 --- a/compiler/extensions/cpp/runtime/test/test_object/std_allocator/CreatorNested.cpp +++ b/compiler/extensions/cpp/runtime/test/test_object/std_allocator/CreatorNested.cpp @@ -1,6 +1,6 @@ /** * Automatically generated by Zserio C++ generator version 1.0.2 using Zserio core 2.14.1. - * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, stdAllocator. + * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, bitPosition, stdAllocator. */ #include @@ -22,6 +22,7 @@ namespace std_allocator CreatorNested::CreatorNested(const allocator_type& allocator) noexcept : m_isInitialized(false), + m_bitPosition(0), m_value_(uint32_t()), m_text_(allocator), m_externData_(allocator), @@ -35,6 +36,7 @@ CreatorNested::CreatorNested(::zserio::BitStreamReader& in, uint32_t param_, const allocator_type& allocator) : m_param_(param_), m_isInitialized(true), + m_bitPosition(in.getBitPosition()), m_value_(readValue(in)), m_text_(readText(in, allocator)), m_externData_(readExternData(in, allocator)), @@ -45,6 +47,7 @@ CreatorNested::CreatorNested(::zserio::BitStreamReader& in, } CreatorNested::CreatorNested(const CreatorNested& other) : + m_bitPosition(other.m_bitPosition), m_value_(other.m_value_), m_text_(other.m_text_), m_externData_(other.m_externData_), @@ -64,6 +67,7 @@ CreatorNested::CreatorNested(const CreatorNested& other) : CreatorNested& CreatorNested::operator=(const CreatorNested& other) { + m_bitPosition = other.m_bitPosition; m_value_ = other.m_value_; m_text_ = other.m_text_; m_externData_ = other.m_externData_; @@ -83,6 +87,7 @@ CreatorNested& CreatorNested::operator=(const CreatorNested& other) } CreatorNested::CreatorNested(CreatorNested&& other) : + m_bitPosition(other.m_bitPosition), m_value_(::std::move(other.m_value_)), m_text_(::std::move(other.m_text_)), m_externData_(::std::move(other.m_externData_)), @@ -102,6 +107,7 @@ CreatorNested::CreatorNested(CreatorNested&& other) : CreatorNested& CreatorNested::operator=(CreatorNested&& other) { + m_bitPosition = other.m_bitPosition; m_value_ = ::std::move(other.m_value_); m_text_ = ::std::move(other.m_text_); m_externData_ = ::std::move(other.m_externData_); @@ -123,6 +129,7 @@ CreatorNested& CreatorNested::operator=(CreatorNested&& other) CreatorNested::CreatorNested(::zserio::NoInitT, const CreatorNested& other) : m_isInitialized(false), + m_bitPosition(other.m_bitPosition), m_value_(other.m_value_), m_text_(other.m_text_), m_externData_(other.m_externData_), @@ -136,6 +143,7 @@ CreatorNested& CreatorNested::assign(::zserio::NoInitT, const CreatorNested& other) { m_isInitialized = false; + m_bitPosition = other.m_bitPosition; m_value_ = other.m_value_; m_text_ = other.m_text_; m_externData_ = other.m_externData_; @@ -149,6 +157,7 @@ CreatorNested& CreatorNested::assign(::zserio::NoInitT, CreatorNested::CreatorNested(::zserio::NoInitT, CreatorNested&& other) : m_isInitialized(false), + m_bitPosition(other.m_bitPosition), m_value_(::std::move(other.m_value_)), m_text_(::std::move(other.m_text_)), m_externData_(::std::move(other.m_externData_)), @@ -162,6 +171,7 @@ CreatorNested& CreatorNested::assign(::zserio::NoInitT, CreatorNested&& other) { m_isInitialized = false; + m_bitPosition = other.m_bitPosition; m_value_ = ::std::move(other.m_value_); m_text_ = ::std::move(other.m_text_); m_externData_ = ::std::move(other.m_externData_); @@ -174,6 +184,7 @@ CreatorNested& CreatorNested::assign(::zserio::NoInitT, CreatorNested::CreatorNested(::zserio::PropagateAllocatorT, const CreatorNested& other, const allocator_type& allocator) : + m_bitPosition(other.m_bitPosition), m_value_(::zserio::allocatorPropagatingCopy(other.m_value_, allocator)), m_text_(::zserio::allocatorPropagatingCopy(other.m_text_, allocator)), m_externData_(::zserio::allocatorPropagatingCopy(other.m_externData_, allocator)), @@ -194,6 +205,7 @@ CreatorNested::CreatorNested(::zserio::PropagateAllocatorT, CreatorNested::CreatorNested(::zserio::PropagateAllocatorT, ::zserio::NoInitT, const CreatorNested& other, const allocator_type& allocator) : m_isInitialized(false), + m_bitPosition(other.m_bitPosition), m_value_(::zserio::allocatorPropagatingCopy(other.m_value_, allocator)), m_text_(::zserio::allocatorPropagatingCopy(other.m_text_, allocator)), m_externData_(::zserio::allocatorPropagatingCopy(other.m_externData_, allocator)), @@ -397,6 +409,11 @@ ::zserio::IReflectableConstPtr CreatorNested::reflectable(const allocator_type& return ::zserio::AnyHolder<>(::std::cref(m_object), alloc); } + size_t bitPosition() const override + { + return m_object.bitPosition(); + } + private: const ::test_object::std_allocator::CreatorNested& m_object; }; @@ -620,6 +637,11 @@ ::zserio::IReflectablePtr CreatorNested::reflectable(const allocator_type& alloc return ::zserio::AnyHolder<>(::std::ref(m_object), alloc); } + size_t bitPosition() const override + { + return m_object.bitPosition(); + } + private: ::test_object::std_allocator::CreatorNested& m_object; }; @@ -877,6 +899,11 @@ void CreatorNested::write(::zserio::BitStreamWriter& out) const m_creatorBitmask_.write(out); } +size_t CreatorNested::bitPosition() const +{ + return m_bitPosition; +} + uint32_t CreatorNested::readValue(::zserio::BitStreamReader& in) { return static_cast(in.readBits(UINT8_C(32))); diff --git a/compiler/extensions/cpp/runtime/test/test_object/std_allocator/CreatorNested.h b/compiler/extensions/cpp/runtime/test/test_object/std_allocator/CreatorNested.h index b984af64e..ec68bb9ac 100644 --- a/compiler/extensions/cpp/runtime/test/test_object/std_allocator/CreatorNested.h +++ b/compiler/extensions/cpp/runtime/test/test_object/std_allocator/CreatorNested.h @@ -1,6 +1,6 @@ /** * Automatically generated by Zserio C++ generator version 1.0.2 using Zserio core 2.14.1. - * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, stdAllocator. + * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, bitPosition, stdAllocator. */ #ifndef TEST_OBJECT_STD_ALLOCATOR_CREATOR_NESTED_H @@ -130,6 +130,8 @@ class CreatorNested void write(::zserio::BitStreamWriter& out) const; + size_t bitPosition() const; + private: uint32_t readValue(::zserio::BitStreamReader& in); ::zserio::string<> readText(::zserio::BitStreamReader& in, @@ -143,6 +145,7 @@ class CreatorNested uint32_t m_param_; bool m_isInitialized; + size_t m_bitPosition; uint32_t m_value_; ::zserio::string<> m_text_; ::zserio::BitBuffer m_externData_; diff --git a/compiler/extensions/cpp/runtime/test/test_object/std_allocator/CreatorObject.cpp b/compiler/extensions/cpp/runtime/test/test_object/std_allocator/CreatorObject.cpp index a62b60681..18608256e 100644 --- a/compiler/extensions/cpp/runtime/test/test_object/std_allocator/CreatorObject.cpp +++ b/compiler/extensions/cpp/runtime/test/test_object/std_allocator/CreatorObject.cpp @@ -1,6 +1,6 @@ /** * Automatically generated by Zserio C++ generator version 1.0.2 using Zserio core 2.14.1. - * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, stdAllocator. + * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, bitPosition, stdAllocator. */ #include @@ -22,6 +22,7 @@ namespace std_allocator CreatorObject::CreatorObject(const allocator_type& allocator) noexcept : m_areChildrenInitialized(false), + m_bitPosition(0), m_value_(uint32_t()), m_nested_(allocator), m_text_(allocator), @@ -36,6 +37,7 @@ CreatorObject::CreatorObject(const allocator_type& allocator) noexcept : CreatorObject::CreatorObject(::zserio::BitStreamReader& in, const allocator_type& allocator) : m_areChildrenInitialized(true), + m_bitPosition(in.getBitPosition()), m_value_(readValue(in)), m_nested_(readNested(in, allocator)), m_text_(readText(in, allocator)), @@ -49,6 +51,7 @@ CreatorObject::CreatorObject(::zserio::BitStreamReader& in, const allocator_type } CreatorObject::CreatorObject(const CreatorObject& other) : + m_bitPosition(other.m_bitPosition), m_value_(other.m_value_), m_nested_(::zserio::NoInit, other.m_nested_), m_text_(other.m_text_), @@ -71,6 +74,7 @@ CreatorObject::CreatorObject(const CreatorObject& other) : CreatorObject& CreatorObject::operator=(const CreatorObject& other) { + m_bitPosition = other.m_bitPosition; m_value_ = other.m_value_; (void)m_nested_.assign(::zserio::NoInit, other.m_nested_); m_text_ = other.m_text_; @@ -93,6 +97,7 @@ CreatorObject& CreatorObject::operator=(const CreatorObject& other) } CreatorObject::CreatorObject(CreatorObject&& other) : + m_bitPosition(other.m_bitPosition), m_value_(::std::move(other.m_value_)), m_nested_(::zserio::NoInit, ::std::move(other.m_nested_)), m_text_(::std::move(other.m_text_)), @@ -115,6 +120,7 @@ CreatorObject::CreatorObject(CreatorObject&& other) : CreatorObject& CreatorObject::operator=(CreatorObject&& other) { + m_bitPosition = other.m_bitPosition; m_value_ = ::std::move(other.m_value_); (void)m_nested_.assign(::zserio::NoInit, ::std::move(other.m_nested_)); m_text_ = ::std::move(other.m_text_); @@ -138,6 +144,7 @@ CreatorObject& CreatorObject::operator=(CreatorObject&& other) CreatorObject::CreatorObject(::zserio::PropagateAllocatorT, const CreatorObject& other, const allocator_type& allocator) : + m_bitPosition(other.m_bitPosition), m_value_(::zserio::allocatorPropagatingCopy(other.m_value_, allocator)), m_nested_(::zserio::NoInit, ::zserio::allocatorPropagatingCopy(::zserio::NoInit, other.m_nested_, allocator)), m_text_(::zserio::allocatorPropagatingCopy(other.m_text_, allocator)), @@ -427,6 +434,11 @@ ::zserio::IReflectableConstPtr CreatorObject::reflectable(const allocator_type& return ::zserio::AnyHolder<>(::std::cref(m_object), alloc); } + size_t bitPosition() const override + { + return m_object.bitPosition(); + } + private: const ::test_object::std_allocator::CreatorObject& m_object; }; @@ -721,6 +733,11 @@ ::zserio::IReflectablePtr CreatorObject::reflectable(const allocator_type& alloc return ::zserio::AnyHolder<>(::std::ref(m_object), alloc); } + size_t bitPosition() const override + { + return m_object.bitPosition(); + } + private: ::test_object::std_allocator::CreatorObject& m_object; }; @@ -732,7 +749,7 @@ void CreatorObject::initializeChildren() { m_nested_.initialize(static_cast(getValue())); m_nestedArray_.initializeElements(*this); - if (isOptionalNestedSet()) + if (m_optionalNested_.hasValue()) { m_optionalNested_.value().initialize(static_cast(getValue())); } @@ -852,7 +869,7 @@ void CreatorObject::setExternArray(::zserio::vector<::zserio::BitBuffer>&& exter bool CreatorObject::isExternArrayUsed() const { - return (isExternArraySet()); + return (m_externArray_.hasValue()); } bool CreatorObject::isExternArraySet() const @@ -887,7 +904,7 @@ void CreatorObject::setBytesArray(::zserio::vector<::zserio::vector>&& bool CreatorObject::isBytesArrayUsed() const { - return (isBytesArraySet()); + return (m_bytesArray_.hasValue()); } bool CreatorObject::isBytesArraySet() const @@ -912,7 +929,7 @@ void CreatorObject::setOptionalBool(bool optionalBool_) bool CreatorObject::isOptionalBoolUsed() const { - return (isOptionalBoolSet()); + return (m_optionalBool_.hasValue()); } bool CreatorObject::isOptionalBoolSet() const @@ -947,7 +964,7 @@ void CreatorObject::setOptionalNested(::test_object::std_allocator::CreatorNeste bool CreatorObject::isOptionalNestedUsed() const { - return (isOptionalNestedSet()); + return (m_optionalNested_.hasValue()); } bool CreatorObject::isOptionalNestedSet() const @@ -970,22 +987,22 @@ size_t CreatorObject::bitSizeOf(size_t bitPosition) const endBitPosition += m_nestedArray_.bitSizeOf(*this, endBitPosition); endBitPosition += m_textArray_.bitSizeOf(endBitPosition); endBitPosition += 1; - if (isExternArraySet()) + if (m_externArray_.hasValue()) { endBitPosition += m_externArray_.value().bitSizeOf(endBitPosition); } endBitPosition += 1; - if (isBytesArraySet()) + if (m_bytesArray_.hasValue()) { endBitPosition += m_bytesArray_.value().bitSizeOf(endBitPosition); } endBitPosition += 1; - if (isOptionalBoolSet()) + if (m_optionalBool_.hasValue()) { endBitPosition += UINT8_C(1); } endBitPosition += 1; - if (isOptionalNestedSet()) + if (m_optionalNested_.hasValue()) { endBitPosition += m_optionalNested_.value().bitSizeOf(endBitPosition); } @@ -1003,22 +1020,22 @@ size_t CreatorObject::initializeOffsets(size_t bitPosition) endBitPosition = m_nestedArray_.initializeOffsets(*this, endBitPosition); endBitPosition = m_textArray_.initializeOffsets(endBitPosition); endBitPosition += 1; - if (isExternArraySet()) + if (m_externArray_.hasValue()) { endBitPosition = m_externArray_.value().initializeOffsets(endBitPosition); } endBitPosition += 1; - if (isBytesArraySet()) + if (m_bytesArray_.hasValue()) { endBitPosition = m_bytesArray_.value().initializeOffsets(endBitPosition); } endBitPosition += 1; - if (isOptionalBoolSet()) + if (m_optionalBool_.hasValue()) { endBitPosition += UINT8_C(1); } endBitPosition += 1; - if (isOptionalNestedSet()) + if (m_optionalNested_.hasValue()) { endBitPosition = m_optionalNested_.value().initializeOffsets(endBitPosition); } @@ -1206,7 +1223,7 @@ void CreatorObject::write(::zserio::BitStreamWriter& out) const m_textArray_.write(out); - if (isExternArraySet()) + if (m_externArray_.hasValue()) { out.writeBool(true); m_externArray_.value().write(out); @@ -1216,7 +1233,7 @@ void CreatorObject::write(::zserio::BitStreamWriter& out) const out.writeBool(false); } - if (isBytesArraySet()) + if (m_bytesArray_.hasValue()) { out.writeBool(true); m_bytesArray_.value().write(out); @@ -1226,7 +1243,7 @@ void CreatorObject::write(::zserio::BitStreamWriter& out) const out.writeBool(false); } - if (isOptionalBoolSet()) + if (m_optionalBool_.hasValue()) { out.writeBool(true); out.writeBool(m_optionalBool_.value()); @@ -1236,7 +1253,7 @@ void CreatorObject::write(::zserio::BitStreamWriter& out) const out.writeBool(false); } - if (isOptionalNestedSet()) + if (m_optionalNested_.hasValue()) { out.writeBool(true); // check parameters @@ -1253,6 +1270,11 @@ void CreatorObject::write(::zserio::BitStreamWriter& out) const } } +size_t CreatorObject::bitPosition() const +{ + return m_bitPosition; +} + void CreatorObject::ZserioArrayExpressions_nestedArray::initializeElement(CreatorObject& owner, ::test_object::std_allocator::CreatorNested& element, size_t) { diff --git a/compiler/extensions/cpp/runtime/test/test_object/std_allocator/CreatorObject.h b/compiler/extensions/cpp/runtime/test/test_object/std_allocator/CreatorObject.h index 37e1c8d02..20e0f6ef9 100644 --- a/compiler/extensions/cpp/runtime/test/test_object/std_allocator/CreatorObject.h +++ b/compiler/extensions/cpp/runtime/test/test_object/std_allocator/CreatorObject.h @@ -1,6 +1,6 @@ /** * Automatically generated by Zserio C++ generator version 1.0.2 using Zserio core 2.14.1. - * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, stdAllocator. + * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, bitPosition, stdAllocator. */ #ifndef TEST_OBJECT_STD_ALLOCATOR_CREATOR_OBJECT_H @@ -155,6 +155,8 @@ class CreatorObject void write(::zserio::BitStreamWriter& out) const; + size_t bitPosition() const; + private: class ZserioArrayExpressions_nestedArray { @@ -198,6 +200,7 @@ class CreatorObject const allocator_type& allocator); bool m_areChildrenInitialized; + size_t m_bitPosition; uint32_t m_value_; ::test_object::std_allocator::CreatorNested m_nested_; ::zserio::string<> m_text_; diff --git a/compiler/extensions/cpp/runtime/test/test_object/std_allocator/CreatorUnsignedEnum.cpp b/compiler/extensions/cpp/runtime/test/test_object/std_allocator/CreatorUnsignedEnum.cpp index 78638cbb6..5c8e515ad 100644 --- a/compiler/extensions/cpp/runtime/test/test_object/std_allocator/CreatorUnsignedEnum.cpp +++ b/compiler/extensions/cpp/runtime/test/test_object/std_allocator/CreatorUnsignedEnum.cpp @@ -1,6 +1,6 @@ /** * Automatically generated by Zserio C++ generator version 1.0.2 using Zserio core 2.14.1. - * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, stdAllocator. + * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, bitPosition, stdAllocator. */ #include diff --git a/compiler/extensions/cpp/runtime/test/test_object/std_allocator/CreatorUnsignedEnum.h b/compiler/extensions/cpp/runtime/test/test_object/std_allocator/CreatorUnsignedEnum.h index 3b01d8031..28d4b2edc 100644 --- a/compiler/extensions/cpp/runtime/test/test_object/std_allocator/CreatorUnsignedEnum.h +++ b/compiler/extensions/cpp/runtime/test/test_object/std_allocator/CreatorUnsignedEnum.h @@ -1,6 +1,6 @@ /** * Automatically generated by Zserio C++ generator version 1.0.2 using Zserio core 2.14.1. - * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, stdAllocator. + * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, bitPosition, stdAllocator. */ #ifndef TEST_OBJECT_STD_ALLOCATOR_CREATOR_UNSIGNED_ENUM_H diff --git a/compiler/extensions/cpp/runtime/test/test_object/std_allocator/DebugStringObject.cpp b/compiler/extensions/cpp/runtime/test/test_object/std_allocator/DebugStringObject.cpp index f957429b9..714ded7ff 100644 --- a/compiler/extensions/cpp/runtime/test/test_object/std_allocator/DebugStringObject.cpp +++ b/compiler/extensions/cpp/runtime/test/test_object/std_allocator/DebugStringObject.cpp @@ -1,6 +1,6 @@ /** * Automatically generated by Zserio C++ generator version 1.0.2 using Zserio core 2.14.1. - * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, stdAllocator. + * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, bitPosition, stdAllocator. */ #include @@ -22,17 +22,20 @@ namespace std_allocator { DebugStringObject::DebugStringObject(const allocator_type& allocator) noexcept : + m_bitPosition(0), m_text_(::zserio::stringViewToString(::zserio::makeStringView("test"), allocator)) { } DebugStringObject::DebugStringObject(::zserio::BitStreamReader& in, const allocator_type& allocator) : + m_bitPosition(in.getBitPosition()), m_text_(readText(in, allocator)) { } DebugStringObject::DebugStringObject(::zserio::PropagateAllocatorT, const DebugStringObject& other, const allocator_type& allocator) : + m_bitPosition(other.m_bitPosition), m_text_(::zserio::allocatorPropagatingCopy(other.m_text_, allocator)) { } @@ -117,6 +120,11 @@ ::zserio::IReflectableConstPtr DebugStringObject::reflectable(const allocator_ty return ::zserio::AnyHolder<>(::std::cref(m_object), alloc); } + size_t bitPosition() const override + { + return m_object.bitPosition(); + } + private: const ::test_object::std_allocator::DebugStringObject& m_object; }; @@ -202,6 +210,11 @@ ::zserio::IReflectablePtr DebugStringObject::reflectable(const allocator_type& a return ::zserio::AnyHolder<>(::std::ref(m_object), alloc); } + size_t bitPosition() const override + { + return m_object.bitPosition(); + } + private: ::test_object::std_allocator::DebugStringObject& m_object; }; @@ -286,6 +299,11 @@ void DebugStringObject::write(::zserio::BitStreamWriter& out) const out.writeString(m_text_); } +size_t DebugStringObject::bitPosition() const +{ + return m_bitPosition; +} + ::zserio::string<> DebugStringObject::readText(::zserio::BitStreamReader& in, const allocator_type& allocator) { diff --git a/compiler/extensions/cpp/runtime/test/test_object/std_allocator/DebugStringObject.h b/compiler/extensions/cpp/runtime/test/test_object/std_allocator/DebugStringObject.h index e52424fb5..a441fd7aa 100644 --- a/compiler/extensions/cpp/runtime/test/test_object/std_allocator/DebugStringObject.h +++ b/compiler/extensions/cpp/runtime/test/test_object/std_allocator/DebugStringObject.h @@ -1,6 +1,6 @@ /** * Automatically generated by Zserio C++ generator version 1.0.2 using Zserio core 2.14.1. - * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, stdAllocator. + * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, bitPosition, stdAllocator. */ #ifndef TEST_OBJECT_STD_ALLOCATOR_DEBUG_STRING_OBJECT_H @@ -76,10 +76,13 @@ class DebugStringObject void write(::zserio::BitStreamWriter& out) const; + size_t bitPosition() const; + private: ::zserio::string<> readText(::zserio::BitStreamReader& in, const allocator_type& allocator); + size_t m_bitPosition; ::zserio::string<> m_text_; }; diff --git a/compiler/extensions/cpp/runtime/test/test_object/std_allocator/DebugStringParamObject.cpp b/compiler/extensions/cpp/runtime/test/test_object/std_allocator/DebugStringParamObject.cpp index adfb531db..b2c179bbf 100644 --- a/compiler/extensions/cpp/runtime/test/test_object/std_allocator/DebugStringParamObject.cpp +++ b/compiler/extensions/cpp/runtime/test/test_object/std_allocator/DebugStringParamObject.cpp @@ -1,6 +1,6 @@ /** * Automatically generated by Zserio C++ generator version 1.0.2 using Zserio core 2.14.1. - * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, stdAllocator. + * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, bitPosition, stdAllocator. */ #include @@ -23,6 +23,7 @@ namespace std_allocator DebugStringParamObject::DebugStringParamObject(const allocator_type& allocator) noexcept : m_isInitialized(false), + m_bitPosition(0), m_text_(::zserio::stringViewToString(::zserio::makeStringView("test"), allocator)) { } @@ -31,11 +32,13 @@ DebugStringParamObject::DebugStringParamObject(::zserio::BitStreamReader& in, int32_t param_, const allocator_type& allocator) : m_param_(param_), m_isInitialized(true), + m_bitPosition(in.getBitPosition()), m_text_(readText(in, allocator)) { } DebugStringParamObject::DebugStringParamObject(const DebugStringParamObject& other) : + m_bitPosition(other.m_bitPosition), m_text_(other.m_text_) { if (other.m_isInitialized) @@ -50,6 +53,7 @@ DebugStringParamObject::DebugStringParamObject(const DebugStringParamObject& oth DebugStringParamObject& DebugStringParamObject::operator=(const DebugStringParamObject& other) { + m_bitPosition = other.m_bitPosition; m_text_ = other.m_text_; if (other.m_isInitialized) { @@ -64,6 +68,7 @@ DebugStringParamObject& DebugStringParamObject::operator=(const DebugStringParam } DebugStringParamObject::DebugStringParamObject(DebugStringParamObject&& other) : + m_bitPosition(other.m_bitPosition), m_text_(::std::move(other.m_text_)) { if (other.m_isInitialized) @@ -78,6 +83,7 @@ DebugStringParamObject::DebugStringParamObject(DebugStringParamObject&& other) : DebugStringParamObject& DebugStringParamObject::operator=(DebugStringParamObject&& other) { + m_bitPosition = other.m_bitPosition; m_text_ = ::std::move(other.m_text_); if (other.m_isInitialized) { @@ -94,6 +100,7 @@ DebugStringParamObject& DebugStringParamObject::operator=(DebugStringParamObject DebugStringParamObject::DebugStringParamObject(::zserio::NoInitT, const DebugStringParamObject& other) : m_isInitialized(false), + m_bitPosition(other.m_bitPosition), m_text_(other.m_text_) { } @@ -102,6 +109,7 @@ DebugStringParamObject& DebugStringParamObject::assign(::zserio::NoInitT, const DebugStringParamObject& other) { m_isInitialized = false; + m_bitPosition = other.m_bitPosition; m_text_ = other.m_text_; return *this; @@ -110,6 +118,7 @@ DebugStringParamObject& DebugStringParamObject::assign(::zserio::NoInitT, DebugStringParamObject::DebugStringParamObject(::zserio::NoInitT, DebugStringParamObject&& other) : m_isInitialized(false), + m_bitPosition(other.m_bitPosition), m_text_(::std::move(other.m_text_)) { } @@ -118,6 +127,7 @@ DebugStringParamObject& DebugStringParamObject::assign(::zserio::NoInitT, DebugStringParamObject&& other) { m_isInitialized = false; + m_bitPosition = other.m_bitPosition; m_text_ = ::std::move(other.m_text_); return *this; @@ -125,6 +135,7 @@ DebugStringParamObject& DebugStringParamObject::assign(::zserio::NoInitT, DebugStringParamObject::DebugStringParamObject(::zserio::PropagateAllocatorT, const DebugStringParamObject& other, const allocator_type& allocator) : + m_bitPosition(other.m_bitPosition), m_text_(::zserio::allocatorPropagatingCopy(other.m_text_, allocator)) { if (other.m_isInitialized) @@ -140,6 +151,7 @@ DebugStringParamObject::DebugStringParamObject(::zserio::PropagateAllocatorT, DebugStringParamObject::DebugStringParamObject(::zserio::PropagateAllocatorT, ::zserio::NoInitT, const DebugStringParamObject& other, const allocator_type& allocator) : m_isInitialized(false), + m_bitPosition(other.m_bitPosition), m_text_(::zserio::allocatorPropagatingCopy(other.m_text_, allocator)) { } @@ -238,6 +250,11 @@ ::zserio::IReflectableConstPtr DebugStringParamObject::reflectable(const allocat return ::zserio::AnyHolder<>(::std::cref(m_object), alloc); } + size_t bitPosition() const override + { + return m_object.bitPosition(); + } + private: const ::test_object::std_allocator::DebugStringParamObject& m_object; }; @@ -355,6 +372,11 @@ ::zserio::IReflectablePtr DebugStringParamObject::reflectable(const allocator_ty return ::zserio::AnyHolder<>(::std::ref(m_object), alloc); } + size_t bitPosition() const override + { + return m_object.bitPosition(); + } + private: ::test_object::std_allocator::DebugStringParamObject& m_object; }; @@ -472,6 +494,11 @@ void DebugStringParamObject::write(::zserio::BitStreamWriter& out) const out.writeString(m_text_); } +size_t DebugStringParamObject::bitPosition() const +{ + return m_bitPosition; +} + ::zserio::string<> DebugStringParamObject::readText(::zserio::BitStreamReader& in, const allocator_type& allocator) { diff --git a/compiler/extensions/cpp/runtime/test/test_object/std_allocator/DebugStringParamObject.h b/compiler/extensions/cpp/runtime/test/test_object/std_allocator/DebugStringParamObject.h index ff552e3a7..7f2b9f2d2 100644 --- a/compiler/extensions/cpp/runtime/test/test_object/std_allocator/DebugStringParamObject.h +++ b/compiler/extensions/cpp/runtime/test/test_object/std_allocator/DebugStringParamObject.h @@ -1,6 +1,6 @@ /** * Automatically generated by Zserio C++ generator version 1.0.2 using Zserio core 2.14.1. - * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, stdAllocator. + * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, bitPosition, stdAllocator. */ #ifndef TEST_OBJECT_STD_ALLOCATOR_DEBUG_STRING_PARAM_OBJECT_H @@ -95,12 +95,15 @@ class DebugStringParamObject void write(::zserio::BitStreamWriter& out) const; + size_t bitPosition() const; + private: ::zserio::string<> readText(::zserio::BitStreamReader& in, const allocator_type& allocator); int32_t m_param_; bool m_isInitialized; + size_t m_bitPosition; ::zserio::string<> m_text_; }; diff --git a/compiler/extensions/cpp/runtime/test/test_object/std_allocator/ReflectableBitmask.cpp b/compiler/extensions/cpp/runtime/test/test_object/std_allocator/ReflectableBitmask.cpp index 40b2f7103..151cc084b 100644 --- a/compiler/extensions/cpp/runtime/test/test_object/std_allocator/ReflectableBitmask.cpp +++ b/compiler/extensions/cpp/runtime/test/test_object/std_allocator/ReflectableBitmask.cpp @@ -1,6 +1,6 @@ /** * Automatically generated by Zserio C++ generator version 1.0.2 using Zserio core 2.14.1. - * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, stdAllocator. + * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, bitPosition, stdAllocator. */ #include diff --git a/compiler/extensions/cpp/runtime/test/test_object/std_allocator/ReflectableBitmask.h b/compiler/extensions/cpp/runtime/test/test_object/std_allocator/ReflectableBitmask.h index b565c00fe..c82e3330e 100644 --- a/compiler/extensions/cpp/runtime/test/test_object/std_allocator/ReflectableBitmask.h +++ b/compiler/extensions/cpp/runtime/test/test_object/std_allocator/ReflectableBitmask.h @@ -1,6 +1,6 @@ /** * Automatically generated by Zserio C++ generator version 1.0.2 using Zserio core 2.14.1. - * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, stdAllocator. + * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, bitPosition, stdAllocator. */ #ifndef TEST_OBJECT_STD_ALLOCATOR_REFLECTABLE_BITMASK_H diff --git a/compiler/extensions/cpp/runtime/test/test_object/std_allocator/ReflectableEnum.cpp b/compiler/extensions/cpp/runtime/test/test_object/std_allocator/ReflectableEnum.cpp index 828b91f77..a3740ee73 100644 --- a/compiler/extensions/cpp/runtime/test/test_object/std_allocator/ReflectableEnum.cpp +++ b/compiler/extensions/cpp/runtime/test/test_object/std_allocator/ReflectableEnum.cpp @@ -1,6 +1,6 @@ /** * Automatically generated by Zserio C++ generator version 1.0.2 using Zserio core 2.14.1. - * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, stdAllocator. + * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, bitPosition, stdAllocator. */ #include diff --git a/compiler/extensions/cpp/runtime/test/test_object/std_allocator/ReflectableEnum.h b/compiler/extensions/cpp/runtime/test/test_object/std_allocator/ReflectableEnum.h index fc49c1527..0e3db556c 100644 --- a/compiler/extensions/cpp/runtime/test/test_object/std_allocator/ReflectableEnum.h +++ b/compiler/extensions/cpp/runtime/test/test_object/std_allocator/ReflectableEnum.h @@ -1,6 +1,6 @@ /** * Automatically generated by Zserio C++ generator version 1.0.2 using Zserio core 2.14.1. - * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, stdAllocator. + * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, bitPosition, stdAllocator. */ #ifndef TEST_OBJECT_STD_ALLOCATOR_REFLECTABLE_ENUM_H diff --git a/compiler/extensions/cpp/runtime/test/test_object/std_allocator/ReflectableNested.cpp b/compiler/extensions/cpp/runtime/test/test_object/std_allocator/ReflectableNested.cpp index f756e7c64..c7aef8bda 100644 --- a/compiler/extensions/cpp/runtime/test/test_object/std_allocator/ReflectableNested.cpp +++ b/compiler/extensions/cpp/runtime/test/test_object/std_allocator/ReflectableNested.cpp @@ -1,6 +1,6 @@ /** * Automatically generated by Zserio C++ generator version 1.0.2 using Zserio core 2.14.1. - * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, stdAllocator. + * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, bitPosition, stdAllocator. */ #include @@ -23,6 +23,7 @@ namespace std_allocator ReflectableNested::ReflectableNested(const allocator_type&) noexcept : m_isInitialized(false), + m_bitPosition(0), m_value_(uint32_t()) { } @@ -33,11 +34,13 @@ ReflectableNested::ReflectableNested(::zserio::BitStreamReader& in, m_dummyParam_(dummyParam_), m_stringParam_(&stringParam_), m_isInitialized(true), + m_bitPosition(in.getBitPosition()), m_value_(readValue(in)) { } ReflectableNested::ReflectableNested(const ReflectableNested& other) : + m_bitPosition(other.m_bitPosition), m_value_(other.m_value_) { if (other.m_isInitialized) @@ -52,6 +55,7 @@ ReflectableNested::ReflectableNested(const ReflectableNested& other) : ReflectableNested& ReflectableNested::operator=(const ReflectableNested& other) { + m_bitPosition = other.m_bitPosition; m_value_ = other.m_value_; if (other.m_isInitialized) { @@ -66,6 +70,7 @@ ReflectableNested& ReflectableNested::operator=(const ReflectableNested& other) } ReflectableNested::ReflectableNested(ReflectableNested&& other) : + m_bitPosition(other.m_bitPosition), m_value_(::std::move(other.m_value_)) { if (other.m_isInitialized) @@ -80,6 +85,7 @@ ReflectableNested::ReflectableNested(ReflectableNested&& other) : ReflectableNested& ReflectableNested::operator=(ReflectableNested&& other) { + m_bitPosition = other.m_bitPosition; m_value_ = ::std::move(other.m_value_); if (other.m_isInitialized) { @@ -96,6 +102,7 @@ ReflectableNested& ReflectableNested::operator=(ReflectableNested&& other) ReflectableNested::ReflectableNested(::zserio::NoInitT, const ReflectableNested& other) : m_isInitialized(false), + m_bitPosition(other.m_bitPosition), m_value_(other.m_value_) { } @@ -104,6 +111,7 @@ ReflectableNested& ReflectableNested::assign(::zserio::NoInitT, const ReflectableNested& other) { m_isInitialized = false; + m_bitPosition = other.m_bitPosition; m_value_ = other.m_value_; return *this; @@ -112,6 +120,7 @@ ReflectableNested& ReflectableNested::assign(::zserio::NoInitT, ReflectableNested::ReflectableNested(::zserio::NoInitT, ReflectableNested&& other) : m_isInitialized(false), + m_bitPosition(other.m_bitPosition), m_value_(::std::move(other.m_value_)) { } @@ -120,6 +129,7 @@ ReflectableNested& ReflectableNested::assign(::zserio::NoInitT, ReflectableNested&& other) { m_isInitialized = false; + m_bitPosition = other.m_bitPosition; m_value_ = ::std::move(other.m_value_); return *this; @@ -127,6 +137,7 @@ ReflectableNested& ReflectableNested::assign(::zserio::NoInitT, ReflectableNested::ReflectableNested(::zserio::PropagateAllocatorT, const ReflectableNested& other, const allocator_type& allocator) : + m_bitPosition(other.m_bitPosition), m_value_(::zserio::allocatorPropagatingCopy(other.m_value_, allocator)) { if (other.m_isInitialized) @@ -142,6 +153,7 @@ ReflectableNested::ReflectableNested(::zserio::PropagateAllocatorT, ReflectableNested::ReflectableNested(::zserio::PropagateAllocatorT, ::zserio::NoInitT, const ReflectableNested& other, const allocator_type& allocator) : m_isInitialized(false), + m_bitPosition(other.m_bitPosition), m_value_(::zserio::allocatorPropagatingCopy(other.m_value_, allocator)) { } @@ -263,6 +275,11 @@ ::zserio::IReflectableConstPtr ReflectableNested::reflectable(const allocator_ty return ::zserio::AnyHolder<>(::std::cref(m_object), alloc); } + size_t bitPosition() const override + { + return m_object.bitPosition(); + } + private: const ::test_object::std_allocator::ReflectableNested& m_object; }; @@ -407,6 +424,11 @@ ::zserio::IReflectablePtr ReflectableNested::reflectable(const allocator_type& a return ::zserio::AnyHolder<>(::std::ref(m_object), alloc); } + size_t bitPosition() const override + { + return m_object.bitPosition(); + } + private: ::test_object::std_allocator::ReflectableNested& m_object; }; @@ -552,6 +574,11 @@ void ReflectableNested::write(::zserio::BitStreamWriter& out) const out.writeBits(m_value_, UINT8_C(31)); } +size_t ReflectableNested::bitPosition() const +{ + return m_bitPosition; +} + uint32_t ReflectableNested::readValue(::zserio::BitStreamReader& in) { return static_cast(in.readBits(UINT8_C(31))); diff --git a/compiler/extensions/cpp/runtime/test/test_object/std_allocator/ReflectableNested.h b/compiler/extensions/cpp/runtime/test/test_object/std_allocator/ReflectableNested.h index 150d3063c..9ebb9ebb9 100644 --- a/compiler/extensions/cpp/runtime/test/test_object/std_allocator/ReflectableNested.h +++ b/compiler/extensions/cpp/runtime/test/test_object/std_allocator/ReflectableNested.h @@ -1,6 +1,6 @@ /** * Automatically generated by Zserio C++ generator version 1.0.2 using Zserio core 2.14.1. - * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, stdAllocator. + * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, bitPosition, stdAllocator. */ #ifndef TEST_OBJECT_STD_ALLOCATOR_REFLECTABLE_NESTED_H @@ -98,12 +98,15 @@ class ReflectableNested void write(::zserio::BitStreamWriter& out) const; + size_t bitPosition() const; + private: uint32_t readValue(::zserio::BitStreamReader& in); int32_t m_dummyParam_; ::zserio::string<>* m_stringParam_; bool m_isInitialized; + size_t m_bitPosition; uint32_t m_value_; }; diff --git a/compiler/extensions/cpp/runtime/test/test_object/std_allocator/ReflectableObject.cpp b/compiler/extensions/cpp/runtime/test/test_object/std_allocator/ReflectableObject.cpp index d7c778b89..3cbae8d99 100644 --- a/compiler/extensions/cpp/runtime/test/test_object/std_allocator/ReflectableObject.cpp +++ b/compiler/extensions/cpp/runtime/test/test_object/std_allocator/ReflectableObject.cpp @@ -1,6 +1,6 @@ /** * Automatically generated by Zserio C++ generator version 1.0.2 using Zserio core 2.14.1. - * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, stdAllocator. + * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, bitPosition, stdAllocator. */ #include @@ -22,6 +22,7 @@ namespace std_allocator ReflectableObject::ReflectableObject(const allocator_type& allocator) noexcept : m_areChildrenInitialized(false), + m_bitPosition(0), m_stringField_(allocator), m_reflectableNested_(allocator) { @@ -29,12 +30,14 @@ ReflectableObject::ReflectableObject(const allocator_type& allocator) noexcept : ReflectableObject::ReflectableObject(::zserio::BitStreamReader& in, const allocator_type& allocator) : m_areChildrenInitialized(true), + m_bitPosition(in.getBitPosition()), m_stringField_(readStringField(in, allocator)), m_reflectableNested_(readReflectableNested(in, allocator)) { } ReflectableObject::ReflectableObject(const ReflectableObject& other) : + m_bitPosition(other.m_bitPosition), m_stringField_(other.m_stringField_), m_reflectableNested_(::zserio::NoInit, other.m_reflectableNested_) { @@ -50,6 +53,7 @@ ReflectableObject::ReflectableObject(const ReflectableObject& other) : ReflectableObject& ReflectableObject::operator=(const ReflectableObject& other) { + m_bitPosition = other.m_bitPosition; m_stringField_ = other.m_stringField_; (void)m_reflectableNested_.assign(::zserio::NoInit, other.m_reflectableNested_); if (other.m_areChildrenInitialized) @@ -65,6 +69,7 @@ ReflectableObject& ReflectableObject::operator=(const ReflectableObject& other) } ReflectableObject::ReflectableObject(ReflectableObject&& other) : + m_bitPosition(other.m_bitPosition), m_stringField_(::std::move(other.m_stringField_)), m_reflectableNested_(::zserio::NoInit, ::std::move(other.m_reflectableNested_)) { @@ -80,6 +85,7 @@ ReflectableObject::ReflectableObject(ReflectableObject&& other) : ReflectableObject& ReflectableObject::operator=(ReflectableObject&& other) { + m_bitPosition = other.m_bitPosition; m_stringField_ = ::std::move(other.m_stringField_); (void)m_reflectableNested_.assign(::zserio::NoInit, ::std::move(other.m_reflectableNested_)); if (other.m_areChildrenInitialized) @@ -96,6 +102,7 @@ ReflectableObject& ReflectableObject::operator=(ReflectableObject&& other) ReflectableObject::ReflectableObject(::zserio::PropagateAllocatorT, const ReflectableObject& other, const allocator_type& allocator) : + m_bitPosition(other.m_bitPosition), m_stringField_(::zserio::allocatorPropagatingCopy(other.m_stringField_, allocator)), m_reflectableNested_(::zserio::NoInit, ::zserio::allocatorPropagatingCopy(::zserio::NoInit, other.m_reflectableNested_, allocator)) { @@ -213,6 +220,11 @@ ::zserio::IReflectableConstPtr ReflectableObject::reflectable(const allocator_ty return ::zserio::AnyHolder<>(::std::cref(m_object), alloc); } + size_t bitPosition() const override + { + return m_object.bitPosition(); + } + private: const ::test_object::std_allocator::ReflectableObject& m_object; }; @@ -317,6 +329,11 @@ ::zserio::IReflectablePtr ReflectableObject::reflectable(const allocator_type& a return ::zserio::AnyHolder<>(::std::ref(m_object), alloc); } + size_t bitPosition() const override + { + return m_object.bitPosition(); + } + private: ::test_object::std_allocator::ReflectableObject& m_object; }; @@ -453,6 +470,11 @@ void ReflectableObject::write(::zserio::BitStreamWriter& out) const m_reflectableNested_.write(out); } +size_t ReflectableObject::bitPosition() const +{ + return m_bitPosition; +} + ::zserio::string<> ReflectableObject::readStringField(::zserio::BitStreamReader& in, const allocator_type& allocator) { diff --git a/compiler/extensions/cpp/runtime/test/test_object/std_allocator/ReflectableObject.h b/compiler/extensions/cpp/runtime/test/test_object/std_allocator/ReflectableObject.h index 4c8f9def9..081c49d32 100644 --- a/compiler/extensions/cpp/runtime/test/test_object/std_allocator/ReflectableObject.h +++ b/compiler/extensions/cpp/runtime/test/test_object/std_allocator/ReflectableObject.h @@ -1,6 +1,6 @@ /** * Automatically generated by Zserio C++ generator version 1.0.2 using Zserio core 2.14.1. - * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, stdAllocator. + * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, bitPosition, stdAllocator. */ #ifndef TEST_OBJECT_STD_ALLOCATOR_REFLECTABLE_OBJECT_H @@ -89,6 +89,8 @@ class ReflectableObject void write(::zserio::BitStreamWriter& out) const; + size_t bitPosition() const; + private: ::zserio::string<> readStringField(::zserio::BitStreamReader& in, const allocator_type& allocator); @@ -96,6 +98,7 @@ class ReflectableObject const allocator_type& allocator); bool m_areChildrenInitialized; + size_t m_bitPosition; ::zserio::string<> m_stringField_; ::test_object::std_allocator::ReflectableNested m_reflectableNested_; }; diff --git a/compiler/extensions/cpp/runtime/test/test_object/std_allocator/ReflectableUtilBitmask.cpp b/compiler/extensions/cpp/runtime/test/test_object/std_allocator/ReflectableUtilBitmask.cpp index 580cd43e3..461443f80 100644 --- a/compiler/extensions/cpp/runtime/test/test_object/std_allocator/ReflectableUtilBitmask.cpp +++ b/compiler/extensions/cpp/runtime/test/test_object/std_allocator/ReflectableUtilBitmask.cpp @@ -1,6 +1,6 @@ /** * Automatically generated by Zserio C++ generator version 1.0.2 using Zserio core 2.14.1. - * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, stdAllocator. + * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, bitPosition, stdAllocator. */ #include diff --git a/compiler/extensions/cpp/runtime/test/test_object/std_allocator/ReflectableUtilBitmask.h b/compiler/extensions/cpp/runtime/test/test_object/std_allocator/ReflectableUtilBitmask.h index e28031bf4..1b3df1c7d 100644 --- a/compiler/extensions/cpp/runtime/test/test_object/std_allocator/ReflectableUtilBitmask.h +++ b/compiler/extensions/cpp/runtime/test/test_object/std_allocator/ReflectableUtilBitmask.h @@ -1,6 +1,6 @@ /** * Automatically generated by Zserio C++ generator version 1.0.2 using Zserio core 2.14.1. - * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, stdAllocator. + * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, bitPosition, stdAllocator. */ #ifndef TEST_OBJECT_STD_ALLOCATOR_REFLECTABLE_UTIL_BITMASK_H diff --git a/compiler/extensions/cpp/runtime/test/test_object/std_allocator/ReflectableUtilChoice.cpp b/compiler/extensions/cpp/runtime/test/test_object/std_allocator/ReflectableUtilChoice.cpp index 6120c187f..d75be14f2 100644 --- a/compiler/extensions/cpp/runtime/test/test_object/std_allocator/ReflectableUtilChoice.cpp +++ b/compiler/extensions/cpp/runtime/test/test_object/std_allocator/ReflectableUtilChoice.cpp @@ -1,6 +1,6 @@ /** * Automatically generated by Zserio C++ generator version 1.0.2 using Zserio core 2.14.1. - * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, stdAllocator. + * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, bitPosition, stdAllocator. */ #include @@ -21,6 +21,7 @@ namespace std_allocator ReflectableUtilChoice::ReflectableUtilChoice(const allocator_type& allocator) noexcept : m_isInitialized(false), + m_bitPosition(0), m_objectChoice(allocator) { } @@ -29,11 +30,13 @@ ReflectableUtilChoice::ReflectableUtilChoice(::zserio::BitStreamReader& in, uint8_t param_, const allocator_type& allocator) : m_param_(param_), m_isInitialized(true), + m_bitPosition(in.getBitPosition()), m_objectChoice(readObject(in, allocator), allocator) { } ReflectableUtilChoice::ReflectableUtilChoice(const ReflectableUtilChoice& other) : + m_bitPosition(other.m_bitPosition), m_objectChoice(::zserio::NoInit, other.m_objectChoice) { if (other.m_isInitialized) @@ -48,6 +51,7 @@ ReflectableUtilChoice::ReflectableUtilChoice(const ReflectableUtilChoice& other) ReflectableUtilChoice& ReflectableUtilChoice::operator=(const ReflectableUtilChoice& other) { + m_bitPosition = other.m_bitPosition; (void)m_objectChoice.assign(::zserio::NoInit, other.m_objectChoice); if (other.m_isInitialized) { @@ -62,6 +66,7 @@ ReflectableUtilChoice& ReflectableUtilChoice::operator=(const ReflectableUtilCho } ReflectableUtilChoice::ReflectableUtilChoice(ReflectableUtilChoice&& other) : + m_bitPosition(other.m_bitPosition), m_objectChoice(::zserio::NoInit, ::std::move(other.m_objectChoice)) { if (other.m_isInitialized) @@ -76,6 +81,7 @@ ReflectableUtilChoice::ReflectableUtilChoice(ReflectableUtilChoice&& other) : ReflectableUtilChoice& ReflectableUtilChoice::operator=(ReflectableUtilChoice&& other) { + m_bitPosition = other.m_bitPosition; (void)m_objectChoice.assign(::zserio::NoInit, ::std::move(other.m_objectChoice)); if (other.m_isInitialized) { @@ -92,6 +98,7 @@ ReflectableUtilChoice& ReflectableUtilChoice::operator=(ReflectableUtilChoice&& ReflectableUtilChoice::ReflectableUtilChoice(::zserio::NoInitT, const ReflectableUtilChoice& other) : m_isInitialized(false), + m_bitPosition(other.m_bitPosition), m_objectChoice(::zserio::NoInit, other.m_objectChoice) { } @@ -100,6 +107,7 @@ ReflectableUtilChoice& ReflectableUtilChoice::assign(::zserio::NoInitT, const ReflectableUtilChoice& other) { m_isInitialized = false; + m_bitPosition = other.m_bitPosition; (void)m_objectChoice.assign(::zserio::NoInit, other.m_objectChoice); return *this; @@ -108,6 +116,7 @@ ReflectableUtilChoice& ReflectableUtilChoice::assign(::zserio::NoInitT, ReflectableUtilChoice::ReflectableUtilChoice(::zserio::NoInitT, ReflectableUtilChoice&& other) : m_isInitialized(false), + m_bitPosition(other.m_bitPosition), m_objectChoice(::zserio::NoInit, ::std::move(other.m_objectChoice)) { } @@ -116,6 +125,7 @@ ReflectableUtilChoice& ReflectableUtilChoice::assign(::zserio::NoInitT, ReflectableUtilChoice&& other) { m_isInitialized = false; + m_bitPosition = other.m_bitPosition; (void)m_objectChoice.assign(::zserio::NoInit, ::std::move(other.m_objectChoice)); return *this; @@ -123,6 +133,7 @@ ReflectableUtilChoice& ReflectableUtilChoice::assign(::zserio::NoInitT, ReflectableUtilChoice::ReflectableUtilChoice(::zserio::PropagateAllocatorT, const ReflectableUtilChoice& other, const allocator_type& allocator) : + m_bitPosition(other.m_bitPosition), m_objectChoice(::zserio::NoInit, other.copyObject(allocator)) { if (other.m_isInitialized) @@ -138,6 +149,7 @@ ReflectableUtilChoice::ReflectableUtilChoice(::zserio::PropagateAllocatorT, ReflectableUtilChoice::ReflectableUtilChoice(::zserio::PropagateAllocatorT, ::zserio::NoInitT, const ReflectableUtilChoice& other, const allocator_type& allocator) : m_isInitialized(false), + m_bitPosition(other.m_bitPosition), m_objectChoice(::zserio::NoInit, other.copyObject(allocator)) { } @@ -262,6 +274,11 @@ ::zserio::IReflectableConstPtr ReflectableUtilChoice::reflectable(const allocato return ::zserio::AnyHolder<>(::std::cref(m_object), alloc); } + size_t bitPosition() const override + { + return m_object.bitPosition(); + } + private: const ::test_object::std_allocator::ReflectableUtilChoice& m_object; }; @@ -391,13 +408,17 @@ ::zserio::IReflectablePtr ReflectableUtilChoice::reflectable(const allocator_typ return ::zserio::AnyHolder<>(::std::ref(m_object), alloc); } + size_t bitPosition() const override + { + return m_object.bitPosition(); + } + private: ::test_object::std_allocator::ReflectableUtilChoice& m_object; }; return std::allocate_shared(allocator, *this, allocator); } - void ReflectableUtilChoice::initialize( uint8_t param_) { @@ -576,6 +597,11 @@ void ReflectableUtilChoice::write(::zserio::BitStreamWriter& out) const } } +size_t ReflectableUtilChoice::bitPosition() const +{ + return m_bitPosition; +} + ::zserio::AnyHolder<> ReflectableUtilChoice::readObject(::zserio::BitStreamReader& in, const allocator_type& allocator) { switch (getParam()) diff --git a/compiler/extensions/cpp/runtime/test/test_object/std_allocator/ReflectableUtilChoice.h b/compiler/extensions/cpp/runtime/test/test_object/std_allocator/ReflectableUtilChoice.h index f0a95761d..0bfc1dca6 100644 --- a/compiler/extensions/cpp/runtime/test/test_object/std_allocator/ReflectableUtilChoice.h +++ b/compiler/extensions/cpp/runtime/test/test_object/std_allocator/ReflectableUtilChoice.h @@ -1,6 +1,6 @@ /** * Automatically generated by Zserio C++ generator version 1.0.2 using Zserio core 2.14.1. - * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, stdAllocator. + * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, bitPosition, stdAllocator. */ #ifndef TEST_OBJECT_STD_ALLOCATOR_REFLECTABLE_UTIL_CHOICE_H @@ -95,6 +95,8 @@ class ReflectableUtilChoice void write(::zserio::BitStreamWriter& out) const; + size_t bitPosition() const; + private: using ZserioArrayType_array = ::zserio::Array<::zserio::vector, ::zserio::StdIntArrayTraits, ::zserio::ArrayType::AUTO>; @@ -103,6 +105,7 @@ class ReflectableUtilChoice uint8_t m_param_; bool m_isInitialized; + size_t m_bitPosition; ::zserio::AnyHolder<> m_objectChoice; }; diff --git a/compiler/extensions/cpp/runtime/test/test_object/std_allocator/ReflectableUtilEnum.cpp b/compiler/extensions/cpp/runtime/test/test_object/std_allocator/ReflectableUtilEnum.cpp index 544b4c4ca..30175a181 100644 --- a/compiler/extensions/cpp/runtime/test/test_object/std_allocator/ReflectableUtilEnum.cpp +++ b/compiler/extensions/cpp/runtime/test/test_object/std_allocator/ReflectableUtilEnum.cpp @@ -1,6 +1,6 @@ /** * Automatically generated by Zserio C++ generator version 1.0.2 using Zserio core 2.14.1. - * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, stdAllocator. + * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, bitPosition, stdAllocator. */ #include diff --git a/compiler/extensions/cpp/runtime/test/test_object/std_allocator/ReflectableUtilEnum.h b/compiler/extensions/cpp/runtime/test/test_object/std_allocator/ReflectableUtilEnum.h index 63167f62e..13ebdc34b 100644 --- a/compiler/extensions/cpp/runtime/test/test_object/std_allocator/ReflectableUtilEnum.h +++ b/compiler/extensions/cpp/runtime/test/test_object/std_allocator/ReflectableUtilEnum.h @@ -1,6 +1,6 @@ /** * Automatically generated by Zserio C++ generator version 1.0.2 using Zserio core 2.14.1. - * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, stdAllocator. + * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, bitPosition, stdAllocator. */ #ifndef TEST_OBJECT_STD_ALLOCATOR_REFLECTABLE_UTIL_ENUM_H diff --git a/compiler/extensions/cpp/runtime/test/test_object/std_allocator/ReflectableUtilObject.cpp b/compiler/extensions/cpp/runtime/test/test_object/std_allocator/ReflectableUtilObject.cpp index 654addfd9..606eea61d 100644 --- a/compiler/extensions/cpp/runtime/test/test_object/std_allocator/ReflectableUtilObject.cpp +++ b/compiler/extensions/cpp/runtime/test/test_object/std_allocator/ReflectableUtilObject.cpp @@ -1,6 +1,6 @@ /** * Automatically generated by Zserio C++ generator version 1.0.2 using Zserio core 2.14.1. - * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, stdAllocator. + * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, bitPosition, stdAllocator. */ #include @@ -22,6 +22,7 @@ namespace std_allocator ReflectableUtilObject::ReflectableUtilObject(const allocator_type& allocator) noexcept : m_areChildrenInitialized(false), + m_bitPosition(0), m_choiceParam_(uint8_t()), m_reflectableUtilChoice_(allocator) { @@ -29,12 +30,14 @@ ReflectableUtilObject::ReflectableUtilObject(const allocator_type& allocator) no ReflectableUtilObject::ReflectableUtilObject(::zserio::BitStreamReader& in, const allocator_type& allocator) : m_areChildrenInitialized(true), + m_bitPosition(in.getBitPosition()), m_choiceParam_(readChoiceParam(in)), m_reflectableUtilChoice_(readReflectableUtilChoice(in, allocator)) { } ReflectableUtilObject::ReflectableUtilObject(const ReflectableUtilObject& other) : + m_bitPosition(other.m_bitPosition), m_choiceParam_(other.m_choiceParam_), m_reflectableUtilChoice_(::zserio::NoInit, other.m_reflectableUtilChoice_) { @@ -50,6 +53,7 @@ ReflectableUtilObject::ReflectableUtilObject(const ReflectableUtilObject& other) ReflectableUtilObject& ReflectableUtilObject::operator=(const ReflectableUtilObject& other) { + m_bitPosition = other.m_bitPosition; m_choiceParam_ = other.m_choiceParam_; (void)m_reflectableUtilChoice_.assign(::zserio::NoInit, other.m_reflectableUtilChoice_); if (other.m_areChildrenInitialized) @@ -65,6 +69,7 @@ ReflectableUtilObject& ReflectableUtilObject::operator=(const ReflectableUtilObj } ReflectableUtilObject::ReflectableUtilObject(ReflectableUtilObject&& other) : + m_bitPosition(other.m_bitPosition), m_choiceParam_(::std::move(other.m_choiceParam_)), m_reflectableUtilChoice_(::zserio::NoInit, ::std::move(other.m_reflectableUtilChoice_)) { @@ -80,6 +85,7 @@ ReflectableUtilObject::ReflectableUtilObject(ReflectableUtilObject&& other) : ReflectableUtilObject& ReflectableUtilObject::operator=(ReflectableUtilObject&& other) { + m_bitPosition = other.m_bitPosition; m_choiceParam_ = ::std::move(other.m_choiceParam_); (void)m_reflectableUtilChoice_.assign(::zserio::NoInit, ::std::move(other.m_reflectableUtilChoice_)); if (other.m_areChildrenInitialized) @@ -96,6 +102,7 @@ ReflectableUtilObject& ReflectableUtilObject::operator=(ReflectableUtilObject&& ReflectableUtilObject::ReflectableUtilObject(::zserio::PropagateAllocatorT, const ReflectableUtilObject& other, const allocator_type& allocator) : + m_bitPosition(other.m_bitPosition), m_choiceParam_(::zserio::allocatorPropagatingCopy(other.m_choiceParam_, allocator)), m_reflectableUtilChoice_(::zserio::NoInit, ::zserio::allocatorPropagatingCopy(::zserio::NoInit, other.m_reflectableUtilChoice_, allocator)) { @@ -212,6 +219,11 @@ ::zserio::IReflectableConstPtr ReflectableUtilObject::reflectable(const allocato return ::zserio::AnyHolder<>(::std::cref(m_object), alloc); } + size_t bitPosition() const override + { + return m_object.bitPosition(); + } + private: const ::test_object::std_allocator::ReflectableUtilObject& m_object; }; @@ -316,6 +328,11 @@ ::zserio::IReflectablePtr ReflectableUtilObject::reflectable(const allocator_typ return ::zserio::AnyHolder<>(::std::ref(m_object), alloc); } + size_t bitPosition() const override + { + return m_object.bitPosition(); + } + private: ::test_object::std_allocator::ReflectableUtilObject& m_object; }; @@ -438,6 +455,11 @@ void ReflectableUtilObject::write(::zserio::BitStreamWriter& out) const m_reflectableUtilChoice_.write(out); } +size_t ReflectableUtilObject::bitPosition() const +{ + return m_bitPosition; +} + uint8_t ReflectableUtilObject::readChoiceParam(::zserio::BitStreamReader& in) { return static_cast(in.readBits(UINT8_C(8))); diff --git a/compiler/extensions/cpp/runtime/test/test_object/std_allocator/ReflectableUtilObject.h b/compiler/extensions/cpp/runtime/test/test_object/std_allocator/ReflectableUtilObject.h index 689111350..10268137f 100644 --- a/compiler/extensions/cpp/runtime/test/test_object/std_allocator/ReflectableUtilObject.h +++ b/compiler/extensions/cpp/runtime/test/test_object/std_allocator/ReflectableUtilObject.h @@ -1,6 +1,6 @@ /** * Automatically generated by Zserio C++ generator version 1.0.2 using Zserio core 2.14.1. - * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, stdAllocator. + * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, bitPosition, stdAllocator. */ #ifndef TEST_OBJECT_STD_ALLOCATOR_REFLECTABLE_UTIL_OBJECT_H @@ -84,12 +84,15 @@ class ReflectableUtilObject void write(::zserio::BitStreamWriter& out) const; + size_t bitPosition() const; + private: uint8_t readChoiceParam(::zserio::BitStreamReader& in); ::test_object::std_allocator::ReflectableUtilChoice readReflectableUtilChoice(::zserio::BitStreamReader& in, const allocator_type& allocator); bool m_areChildrenInitialized; + size_t m_bitPosition; uint8_t m_choiceParam_; ::test_object::std_allocator::ReflectableUtilChoice m_reflectableUtilChoice_; }; diff --git a/compiler/extensions/cpp/runtime/test/test_object/std_allocator/ReflectableUtilUnion.cpp b/compiler/extensions/cpp/runtime/test/test_object/std_allocator/ReflectableUtilUnion.cpp index c8b18607a..517359a4c 100644 --- a/compiler/extensions/cpp/runtime/test/test_object/std_allocator/ReflectableUtilUnion.cpp +++ b/compiler/extensions/cpp/runtime/test/test_object/std_allocator/ReflectableUtilUnion.cpp @@ -1,6 +1,6 @@ /** * Automatically generated by Zserio C++ generator version 1.0.2 using Zserio core 2.14.1. - * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, stdAllocator. + * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, bitPosition, stdAllocator. */ #include @@ -20,12 +20,14 @@ namespace std_allocator { ReflectableUtilUnion::ReflectableUtilUnion(const allocator_type& allocator) noexcept : + m_bitPosition(0), m_choiceTag(UNDEFINED_CHOICE), m_objectChoice(allocator) { } ReflectableUtilUnion::ReflectableUtilUnion(::zserio::BitStreamReader& in, const allocator_type& allocator) : + m_bitPosition(in.getBitPosition()), m_choiceTag(readChoiceTag(in)), m_objectChoice(readObject(in, allocator)) { @@ -33,6 +35,7 @@ ReflectableUtilUnion::ReflectableUtilUnion(::zserio::BitStreamReader& in, const ReflectableUtilUnion::ReflectableUtilUnion(::zserio::PropagateAllocatorT, const ReflectableUtilUnion& other, const allocator_type& allocator) : + m_bitPosition(other.m_bitPosition), m_choiceTag(other.m_choiceTag), m_objectChoice(::zserio::NoInit, other.copyObject(allocator)) { @@ -173,6 +176,11 @@ ::zserio::IReflectableConstPtr ReflectableUtilUnion::reflectable(const allocator return ::zserio::AnyHolder<>(::std::cref(m_object), alloc); } + size_t bitPosition() const override + { + return m_object.bitPosition(); + } + private: const ::test_object::std_allocator::ReflectableUtilUnion& m_object; }; @@ -326,6 +334,11 @@ ::zserio::IReflectablePtr ReflectableUtilUnion::reflectable(const allocator_type return ::zserio::AnyHolder<>(::std::ref(m_object), alloc); } + size_t bitPosition() const override + { + return m_object.bitPosition(); + } + private: ::test_object::std_allocator::ReflectableUtilUnion& m_object; }; @@ -575,6 +588,11 @@ void ReflectableUtilUnion::write(::zserio::BitStreamWriter& out) const } } +size_t ReflectableUtilUnion::bitPosition() const +{ + return m_bitPosition; +} + ReflectableUtilUnion::ChoiceTag ReflectableUtilUnion::readChoiceTag(::zserio::BitStreamReader& in) { return static_cast(static_cast(in.readVarSize())); diff --git a/compiler/extensions/cpp/runtime/test/test_object/std_allocator/ReflectableUtilUnion.h b/compiler/extensions/cpp/runtime/test/test_object/std_allocator/ReflectableUtilUnion.h index b441686f6..2b64ab0f0 100644 --- a/compiler/extensions/cpp/runtime/test/test_object/std_allocator/ReflectableUtilUnion.h +++ b/compiler/extensions/cpp/runtime/test/test_object/std_allocator/ReflectableUtilUnion.h @@ -1,6 +1,6 @@ /** * Automatically generated by Zserio C++ generator version 1.0.2 using Zserio core 2.14.1. - * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, stdAllocator. + * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, bitPosition, stdAllocator. */ #ifndef TEST_OBJECT_STD_ALLOCATOR_REFLECTABLE_UTIL_UNION_H @@ -88,11 +88,14 @@ class ReflectableUtilUnion void write(::zserio::BitStreamWriter& out) const; + size_t bitPosition() const; + private: ChoiceTag readChoiceTag(::zserio::BitStreamReader& in); ::zserio::AnyHolder<> readObject(::zserio::BitStreamReader& in, const allocator_type& allocator); ::zserio::AnyHolder<> copyObject(const allocator_type& allocator) const; + size_t m_bitPosition; ChoiceTag m_choiceTag; ::zserio::AnyHolder<> m_objectChoice; }; diff --git a/compiler/extensions/cpp/runtime/test/test_object/std_allocator/SerializeEnum.cpp b/compiler/extensions/cpp/runtime/test/test_object/std_allocator/SerializeEnum.cpp index d2a4f8dac..442632399 100644 --- a/compiler/extensions/cpp/runtime/test/test_object/std_allocator/SerializeEnum.cpp +++ b/compiler/extensions/cpp/runtime/test/test_object/std_allocator/SerializeEnum.cpp @@ -1,6 +1,6 @@ /** * Automatically generated by Zserio C++ generator version 1.0.2 using Zserio core 2.14.1. - * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, stdAllocator. + * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, bitPosition, stdAllocator. */ #include diff --git a/compiler/extensions/cpp/runtime/test/test_object/std_allocator/SerializeEnum.h b/compiler/extensions/cpp/runtime/test/test_object/std_allocator/SerializeEnum.h index baad30db5..73351d0bf 100644 --- a/compiler/extensions/cpp/runtime/test/test_object/std_allocator/SerializeEnum.h +++ b/compiler/extensions/cpp/runtime/test/test_object/std_allocator/SerializeEnum.h @@ -1,6 +1,6 @@ /** * Automatically generated by Zserio C++ generator version 1.0.2 using Zserio core 2.14.1. - * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, stdAllocator. + * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, bitPosition, stdAllocator. */ #ifndef TEST_OBJECT_STD_ALLOCATOR_SERIALIZE_ENUM_H diff --git a/compiler/extensions/cpp/runtime/test/test_object/std_allocator/SerializeNested.cpp b/compiler/extensions/cpp/runtime/test/test_object/std_allocator/SerializeNested.cpp index bd669fb40..42f6c08aa 100644 --- a/compiler/extensions/cpp/runtime/test/test_object/std_allocator/SerializeNested.cpp +++ b/compiler/extensions/cpp/runtime/test/test_object/std_allocator/SerializeNested.cpp @@ -1,6 +1,6 @@ /** * Automatically generated by Zserio C++ generator version 1.0.2 using Zserio core 2.14.1. - * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, stdAllocator. + * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, bitPosition, stdAllocator. */ #include @@ -22,6 +22,7 @@ namespace std_allocator SerializeNested::SerializeNested(const allocator_type&) noexcept : m_isInitialized(false), + m_bitPosition(0), m_offset_(uint8_t()), m_optionalValue_(::zserio::NullOpt) { @@ -31,12 +32,14 @@ SerializeNested::SerializeNested(::zserio::BitStreamReader& in, int8_t param_, const allocator_type&) : m_param_(param_), m_isInitialized(true), + m_bitPosition(in.getBitPosition()), m_offset_(readOffset(in)), m_optionalValue_(readOptionalValue(in)) { } SerializeNested::SerializeNested(const SerializeNested& other) : + m_bitPosition(other.m_bitPosition), m_offset_(other.m_offset_), m_optionalValue_(other.m_optionalValue_) { @@ -52,6 +55,7 @@ SerializeNested::SerializeNested(const SerializeNested& other) : SerializeNested& SerializeNested::operator=(const SerializeNested& other) { + m_bitPosition = other.m_bitPosition; m_offset_ = other.m_offset_; m_optionalValue_ = other.m_optionalValue_; if (other.m_isInitialized) @@ -67,6 +71,7 @@ SerializeNested& SerializeNested::operator=(const SerializeNested& other) } SerializeNested::SerializeNested(SerializeNested&& other) : + m_bitPosition(other.m_bitPosition), m_offset_(::std::move(other.m_offset_)), m_optionalValue_(::std::move(other.m_optionalValue_)) { @@ -82,6 +87,7 @@ SerializeNested::SerializeNested(SerializeNested&& other) : SerializeNested& SerializeNested::operator=(SerializeNested&& other) { + m_bitPosition = other.m_bitPosition; m_offset_ = ::std::move(other.m_offset_); m_optionalValue_ = ::std::move(other.m_optionalValue_); if (other.m_isInitialized) @@ -99,6 +105,7 @@ SerializeNested& SerializeNested::operator=(SerializeNested&& other) SerializeNested::SerializeNested(::zserio::NoInitT, const SerializeNested& other) : m_isInitialized(false), + m_bitPosition(other.m_bitPosition), m_offset_(other.m_offset_), m_optionalValue_(other.m_optionalValue_) { @@ -108,6 +115,7 @@ SerializeNested& SerializeNested::assign(::zserio::NoInitT, const SerializeNested& other) { m_isInitialized = false; + m_bitPosition = other.m_bitPosition; m_offset_ = other.m_offset_; m_optionalValue_ = other.m_optionalValue_; @@ -117,6 +125,7 @@ SerializeNested& SerializeNested::assign(::zserio::NoInitT, SerializeNested::SerializeNested(::zserio::NoInitT, SerializeNested&& other) : m_isInitialized(false), + m_bitPosition(other.m_bitPosition), m_offset_(::std::move(other.m_offset_)), m_optionalValue_(::std::move(other.m_optionalValue_)) { @@ -126,6 +135,7 @@ SerializeNested& SerializeNested::assign(::zserio::NoInitT, SerializeNested&& other) { m_isInitialized = false; + m_bitPosition = other.m_bitPosition; m_offset_ = ::std::move(other.m_offset_); m_optionalValue_ = ::std::move(other.m_optionalValue_); @@ -134,6 +144,7 @@ SerializeNested& SerializeNested::assign(::zserio::NoInitT, SerializeNested::SerializeNested(::zserio::PropagateAllocatorT, const SerializeNested& other, const allocator_type& allocator) : + m_bitPosition(other.m_bitPosition), m_offset_(::zserio::allocatorPropagatingCopy(other.m_offset_, allocator)), m_optionalValue_(::zserio::allocatorPropagatingCopy(other.m_optionalValue_, allocator)) { @@ -150,6 +161,7 @@ SerializeNested::SerializeNested(::zserio::PropagateAllocatorT, SerializeNested::SerializeNested(::zserio::PropagateAllocatorT, ::zserio::NoInitT, const SerializeNested& other, const allocator_type& allocator) : m_isInitialized(false), + m_bitPosition(other.m_bitPosition), m_offset_(::zserio::allocatorPropagatingCopy(other.m_offset_, allocator)), m_optionalValue_(::zserio::allocatorPropagatingCopy(other.m_optionalValue_, allocator)) { @@ -274,6 +286,11 @@ ::zserio::IReflectableConstPtr SerializeNested::reflectable(const allocator_type return ::zserio::AnyHolder<>(::std::cref(m_object), alloc); } + size_t bitPosition() const override + { + return m_object.bitPosition(); + } + private: const ::test_object::std_allocator::SerializeNested& m_object; }; @@ -425,6 +442,11 @@ ::zserio::IReflectablePtr SerializeNested::reflectable(const allocator_type& all return ::zserio::AnyHolder<>(::std::ref(m_object), alloc); } + size_t bitPosition() const override + { + return m_object.bitPosition(); + } + private: ::test_object::std_allocator::SerializeNested& m_object; }; @@ -605,6 +627,11 @@ void SerializeNested::write(::zserio::BitStreamWriter& out) const } } +size_t SerializeNested::bitPosition() const +{ + return m_bitPosition; +} + uint8_t SerializeNested::readOffset(::zserio::BitStreamReader& in) { return static_cast(in.readBits(UINT8_C(8))); diff --git a/compiler/extensions/cpp/runtime/test/test_object/std_allocator/SerializeNested.h b/compiler/extensions/cpp/runtime/test/test_object/std_allocator/SerializeNested.h index 298a0f17f..289a13a8a 100644 --- a/compiler/extensions/cpp/runtime/test/test_object/std_allocator/SerializeNested.h +++ b/compiler/extensions/cpp/runtime/test/test_object/std_allocator/SerializeNested.h @@ -1,6 +1,6 @@ /** * Automatically generated by Zserio C++ generator version 1.0.2 using Zserio core 2.14.1. - * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, stdAllocator. + * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, bitPosition, stdAllocator. */ #ifndef TEST_OBJECT_STD_ALLOCATOR_SERIALIZE_NESTED_H @@ -100,12 +100,15 @@ class SerializeNested void write(::zserio::BitStreamWriter& out) const; + size_t bitPosition() const; + private: uint8_t readOffset(::zserio::BitStreamReader& in); ::zserio::InplaceOptionalHolder readOptionalValue(::zserio::BitStreamReader& in); int8_t m_param_; bool m_isInitialized; + size_t m_bitPosition; uint8_t m_offset_; ::zserio::InplaceOptionalHolder m_optionalValue_; }; diff --git a/compiler/extensions/cpp/runtime/test/test_object/std_allocator/SerializeObject.cpp b/compiler/extensions/cpp/runtime/test/test_object/std_allocator/SerializeObject.cpp index f92df8a76..a7777b305 100644 --- a/compiler/extensions/cpp/runtime/test/test_object/std_allocator/SerializeObject.cpp +++ b/compiler/extensions/cpp/runtime/test/test_object/std_allocator/SerializeObject.cpp @@ -1,6 +1,6 @@ /** * Automatically generated by Zserio C++ generator version 1.0.2 using Zserio core 2.14.1. - * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, stdAllocator. + * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, bitPosition, stdAllocator. */ #include @@ -22,6 +22,7 @@ namespace std_allocator SerializeObject::SerializeObject(const allocator_type& allocator) noexcept : m_areChildrenInitialized(false), + m_bitPosition(0), m_param_(int8_t()), m_nested_(allocator) { @@ -29,12 +30,14 @@ SerializeObject::SerializeObject(const allocator_type& allocator) noexcept : SerializeObject::SerializeObject(::zserio::BitStreamReader& in, const allocator_type& allocator) : m_areChildrenInitialized(true), + m_bitPosition(in.getBitPosition()), m_param_(readParam(in)), m_nested_(readNested(in, allocator)) { } SerializeObject::SerializeObject(const SerializeObject& other) : + m_bitPosition(other.m_bitPosition), m_param_(other.m_param_), m_nested_(::zserio::NoInit, other.m_nested_) { @@ -50,6 +53,7 @@ SerializeObject::SerializeObject(const SerializeObject& other) : SerializeObject& SerializeObject::operator=(const SerializeObject& other) { + m_bitPosition = other.m_bitPosition; m_param_ = other.m_param_; (void)m_nested_.assign(::zserio::NoInit, other.m_nested_); if (other.m_areChildrenInitialized) @@ -65,6 +69,7 @@ SerializeObject& SerializeObject::operator=(const SerializeObject& other) } SerializeObject::SerializeObject(SerializeObject&& other) : + m_bitPosition(other.m_bitPosition), m_param_(::std::move(other.m_param_)), m_nested_(::zserio::NoInit, ::std::move(other.m_nested_)) { @@ -80,6 +85,7 @@ SerializeObject::SerializeObject(SerializeObject&& other) : SerializeObject& SerializeObject::operator=(SerializeObject&& other) { + m_bitPosition = other.m_bitPosition; m_param_ = ::std::move(other.m_param_); (void)m_nested_.assign(::zserio::NoInit, ::std::move(other.m_nested_)); if (other.m_areChildrenInitialized) @@ -96,6 +102,7 @@ SerializeObject& SerializeObject::operator=(SerializeObject&& other) SerializeObject::SerializeObject(::zserio::PropagateAllocatorT, const SerializeObject& other, const allocator_type& allocator) : + m_bitPosition(other.m_bitPosition), m_param_(::zserio::allocatorPropagatingCopy(other.m_param_, allocator)), m_nested_(::zserio::NoInit, ::zserio::allocatorPropagatingCopy(::zserio::NoInit, other.m_nested_, allocator)) { @@ -212,6 +219,11 @@ ::zserio::IReflectableConstPtr SerializeObject::reflectable(const allocator_type return ::zserio::AnyHolder<>(::std::cref(m_object), alloc); } + size_t bitPosition() const override + { + return m_object.bitPosition(); + } + private: const ::test_object::std_allocator::SerializeObject& m_object; }; @@ -316,6 +328,11 @@ ::zserio::IReflectablePtr SerializeObject::reflectable(const allocator_type& all return ::zserio::AnyHolder<>(::std::ref(m_object), alloc); } + size_t bitPosition() const override + { + return m_object.bitPosition(); + } + private: ::test_object::std_allocator::SerializeObject& m_object; }; @@ -438,6 +455,11 @@ void SerializeObject::write(::zserio::BitStreamWriter& out) const m_nested_.write(out); } +size_t SerializeObject::bitPosition() const +{ + return m_bitPosition; +} + int8_t SerializeObject::readParam(::zserio::BitStreamReader& in) { return static_cast(in.readSignedBits(UINT8_C(8))); diff --git a/compiler/extensions/cpp/runtime/test/test_object/std_allocator/SerializeObject.h b/compiler/extensions/cpp/runtime/test/test_object/std_allocator/SerializeObject.h index 7770a7024..cb16f0af0 100644 --- a/compiler/extensions/cpp/runtime/test/test_object/std_allocator/SerializeObject.h +++ b/compiler/extensions/cpp/runtime/test/test_object/std_allocator/SerializeObject.h @@ -1,6 +1,6 @@ /** * Automatically generated by Zserio C++ generator version 1.0.2 using Zserio core 2.14.1. - * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, stdAllocator. + * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, bitPosition, stdAllocator. */ #ifndef TEST_OBJECT_STD_ALLOCATOR_SERIALIZE_OBJECT_H @@ -84,12 +84,15 @@ class SerializeObject void write(::zserio::BitStreamWriter& out) const; + size_t bitPosition() const; + private: int8_t readParam(::zserio::BitStreamReader& in); ::test_object::std_allocator::SerializeNested readNested(::zserio::BitStreamReader& in, const allocator_type& allocator); bool m_areChildrenInitialized; + size_t m_bitPosition; int8_t m_param_; ::test_object::std_allocator::SerializeNested m_nested_; }; diff --git a/compiler/extensions/cpp/runtime/test/test_object/std_allocator/WalkerBitmask.cpp b/compiler/extensions/cpp/runtime/test/test_object/std_allocator/WalkerBitmask.cpp index 7048f2414..a52940440 100644 --- a/compiler/extensions/cpp/runtime/test/test_object/std_allocator/WalkerBitmask.cpp +++ b/compiler/extensions/cpp/runtime/test/test_object/std_allocator/WalkerBitmask.cpp @@ -1,6 +1,6 @@ /** * Automatically generated by Zserio C++ generator version 1.0.2 using Zserio core 2.14.1. - * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, stdAllocator. + * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, bitPosition, stdAllocator. */ #include diff --git a/compiler/extensions/cpp/runtime/test/test_object/std_allocator/WalkerBitmask.h b/compiler/extensions/cpp/runtime/test/test_object/std_allocator/WalkerBitmask.h index 1f35a46fa..0c9b5c2b4 100644 --- a/compiler/extensions/cpp/runtime/test/test_object/std_allocator/WalkerBitmask.h +++ b/compiler/extensions/cpp/runtime/test/test_object/std_allocator/WalkerBitmask.h @@ -1,6 +1,6 @@ /** * Automatically generated by Zserio C++ generator version 1.0.2 using Zserio core 2.14.1. - * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, stdAllocator. + * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, bitPosition, stdAllocator. */ #ifndef TEST_OBJECT_STD_ALLOCATOR_WALKER_BITMASK_H diff --git a/compiler/extensions/cpp/runtime/test/test_object/std_allocator/WalkerChoice.cpp b/compiler/extensions/cpp/runtime/test/test_object/std_allocator/WalkerChoice.cpp index 5786f7e30..2e78c1e32 100644 --- a/compiler/extensions/cpp/runtime/test/test_object/std_allocator/WalkerChoice.cpp +++ b/compiler/extensions/cpp/runtime/test/test_object/std_allocator/WalkerChoice.cpp @@ -1,6 +1,6 @@ /** * Automatically generated by Zserio C++ generator version 1.0.2 using Zserio core 2.14.1. - * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, stdAllocator. + * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, bitPosition, stdAllocator. */ #include @@ -21,6 +21,7 @@ namespace std_allocator WalkerChoice::WalkerChoice(const allocator_type& allocator) noexcept : m_isInitialized(false), + m_bitPosition(0), m_objectChoice(allocator) { } @@ -29,11 +30,13 @@ WalkerChoice::WalkerChoice(::zserio::BitStreamReader& in, uint8_t selector_, const allocator_type& allocator) : m_selector_(selector_), m_isInitialized(true), + m_bitPosition(in.getBitPosition()), m_objectChoice(readObject(in, allocator), allocator) { } WalkerChoice::WalkerChoice(const WalkerChoice& other) : + m_bitPosition(other.m_bitPosition), m_objectChoice(::zserio::NoInit, other.m_objectChoice) { if (other.m_isInitialized) @@ -48,6 +51,7 @@ WalkerChoice::WalkerChoice(const WalkerChoice& other) : WalkerChoice& WalkerChoice::operator=(const WalkerChoice& other) { + m_bitPosition = other.m_bitPosition; (void)m_objectChoice.assign(::zserio::NoInit, other.m_objectChoice); if (other.m_isInitialized) { @@ -62,6 +66,7 @@ WalkerChoice& WalkerChoice::operator=(const WalkerChoice& other) } WalkerChoice::WalkerChoice(WalkerChoice&& other) : + m_bitPosition(other.m_bitPosition), m_objectChoice(::zserio::NoInit, ::std::move(other.m_objectChoice)) { if (other.m_isInitialized) @@ -76,6 +81,7 @@ WalkerChoice::WalkerChoice(WalkerChoice&& other) : WalkerChoice& WalkerChoice::operator=(WalkerChoice&& other) { + m_bitPosition = other.m_bitPosition; (void)m_objectChoice.assign(::zserio::NoInit, ::std::move(other.m_objectChoice)); if (other.m_isInitialized) { @@ -92,6 +98,7 @@ WalkerChoice& WalkerChoice::operator=(WalkerChoice&& other) WalkerChoice::WalkerChoice(::zserio::NoInitT, const WalkerChoice& other) : m_isInitialized(false), + m_bitPosition(other.m_bitPosition), m_objectChoice(::zserio::NoInit, other.m_objectChoice) { } @@ -100,6 +107,7 @@ WalkerChoice& WalkerChoice::assign(::zserio::NoInitT, const WalkerChoice& other) { m_isInitialized = false; + m_bitPosition = other.m_bitPosition; (void)m_objectChoice.assign(::zserio::NoInit, other.m_objectChoice); return *this; @@ -108,6 +116,7 @@ WalkerChoice& WalkerChoice::assign(::zserio::NoInitT, WalkerChoice::WalkerChoice(::zserio::NoInitT, WalkerChoice&& other) : m_isInitialized(false), + m_bitPosition(other.m_bitPosition), m_objectChoice(::zserio::NoInit, ::std::move(other.m_objectChoice)) { } @@ -116,6 +125,7 @@ WalkerChoice& WalkerChoice::assign(::zserio::NoInitT, WalkerChoice&& other) { m_isInitialized = false; + m_bitPosition = other.m_bitPosition; (void)m_objectChoice.assign(::zserio::NoInit, ::std::move(other.m_objectChoice)); return *this; @@ -123,6 +133,7 @@ WalkerChoice& WalkerChoice::assign(::zserio::NoInitT, WalkerChoice::WalkerChoice(::zserio::PropagateAllocatorT, const WalkerChoice& other, const allocator_type& allocator) : + m_bitPosition(other.m_bitPosition), m_objectChoice(::zserio::NoInit, other.copyObject(allocator)) { if (other.m_isInitialized) @@ -138,6 +149,7 @@ WalkerChoice::WalkerChoice(::zserio::PropagateAllocatorT, WalkerChoice::WalkerChoice(::zserio::PropagateAllocatorT, ::zserio::NoInitT, const WalkerChoice& other, const allocator_type& allocator) : m_isInitialized(false), + m_bitPosition(other.m_bitPosition), m_objectChoice(::zserio::NoInit, other.copyObject(allocator)) { } @@ -347,6 +359,11 @@ ::zserio::IReflectableConstPtr WalkerChoice::reflectable(const allocator_type& a return ::zserio::AnyHolder<>(::std::cref(m_object), alloc); } + size_t bitPosition() const override + { + return m_object.bitPosition(); + } + private: const ::test_object::std_allocator::WalkerChoice& m_object; }; @@ -535,13 +552,17 @@ ::zserio::IReflectablePtr WalkerChoice::reflectable(const allocator_type& alloca return ::zserio::AnyHolder<>(::std::ref(m_object), alloc); } + size_t bitPosition() const override + { + return m_object.bitPosition(); + } + private: ::test_object::std_allocator::WalkerChoice& m_object; }; return std::allocate_shared(allocator, *this, allocator); } - void WalkerChoice::initialize( uint8_t selector_) { @@ -814,6 +835,11 @@ void WalkerChoice::write(::zserio::BitStreamWriter& out) const } } +size_t WalkerChoice::bitPosition() const +{ + return m_bitPosition; +} + ::zserio::AnyHolder<> WalkerChoice::readObject(::zserio::BitStreamReader& in, const allocator_type& allocator) { switch (getSelector()) diff --git a/compiler/extensions/cpp/runtime/test/test_object/std_allocator/WalkerChoice.h b/compiler/extensions/cpp/runtime/test/test_object/std_allocator/WalkerChoice.h index 8fc4bc187..7bb7470d8 100644 --- a/compiler/extensions/cpp/runtime/test/test_object/std_allocator/WalkerChoice.h +++ b/compiler/extensions/cpp/runtime/test/test_object/std_allocator/WalkerChoice.h @@ -1,6 +1,6 @@ /** * Automatically generated by Zserio C++ generator version 1.0.2 using Zserio core 2.14.1. - * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, stdAllocator. + * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, bitPosition, stdAllocator. */ #ifndef TEST_OBJECT_STD_ALLOCATOR_WALKER_CHOICE_H @@ -103,12 +103,15 @@ class WalkerChoice void write(::zserio::BitStreamWriter& out) const; + size_t bitPosition() const; + private: ::zserio::AnyHolder<> readObject(::zserio::BitStreamReader& in, const allocator_type& allocator); ::zserio::AnyHolder<> copyObject(const allocator_type& allocator) const; uint8_t m_selector_; bool m_isInitialized; + size_t m_bitPosition; ::zserio::AnyHolder<> m_objectChoice; }; diff --git a/compiler/extensions/cpp/runtime/test/test_object/std_allocator/WalkerNested.cpp b/compiler/extensions/cpp/runtime/test/test_object/std_allocator/WalkerNested.cpp index 62bc3e7f7..41ab94350 100644 --- a/compiler/extensions/cpp/runtime/test/test_object/std_allocator/WalkerNested.cpp +++ b/compiler/extensions/cpp/runtime/test/test_object/std_allocator/WalkerNested.cpp @@ -1,6 +1,6 @@ /** * Automatically generated by Zserio C++ generator version 1.0.2 using Zserio core 2.14.1. - * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, stdAllocator. + * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, bitPosition, stdAllocator. */ #include @@ -21,17 +21,20 @@ namespace std_allocator { WalkerNested::WalkerNested(const allocator_type& allocator) noexcept : + m_bitPosition(0), m_text_(allocator) { } WalkerNested::WalkerNested(::zserio::BitStreamReader& in, const allocator_type& allocator) : + m_bitPosition(in.getBitPosition()), m_text_(readText(in, allocator)) { } WalkerNested::WalkerNested(::zserio::PropagateAllocatorT, const WalkerNested& other, const allocator_type& allocator) : + m_bitPosition(other.m_bitPosition), m_text_(::zserio::allocatorPropagatingCopy(other.m_text_, allocator)) { } @@ -116,6 +119,11 @@ ::zserio::IReflectableConstPtr WalkerNested::reflectable(const allocator_type& a return ::zserio::AnyHolder<>(::std::cref(m_object), alloc); } + size_t bitPosition() const override + { + return m_object.bitPosition(); + } + private: const ::test_object::std_allocator::WalkerNested& m_object; }; @@ -201,6 +209,11 @@ ::zserio::IReflectablePtr WalkerNested::reflectable(const allocator_type& alloca return ::zserio::AnyHolder<>(::std::ref(m_object), alloc); } + size_t bitPosition() const override + { + return m_object.bitPosition(); + } + private: ::test_object::std_allocator::WalkerNested& m_object; }; @@ -285,6 +298,11 @@ void WalkerNested::write(::zserio::BitStreamWriter& out) const out.writeString(m_text_); } +size_t WalkerNested::bitPosition() const +{ + return m_bitPosition; +} + ::zserio::string<> WalkerNested::readText(::zserio::BitStreamReader& in, const allocator_type& allocator) { diff --git a/compiler/extensions/cpp/runtime/test/test_object/std_allocator/WalkerNested.h b/compiler/extensions/cpp/runtime/test/test_object/std_allocator/WalkerNested.h index 8080ee573..9acaff71e 100644 --- a/compiler/extensions/cpp/runtime/test/test_object/std_allocator/WalkerNested.h +++ b/compiler/extensions/cpp/runtime/test/test_object/std_allocator/WalkerNested.h @@ -1,6 +1,6 @@ /** * Automatically generated by Zserio C++ generator version 1.0.2 using Zserio core 2.14.1. - * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, stdAllocator. + * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, bitPosition, stdAllocator. */ #ifndef TEST_OBJECT_STD_ALLOCATOR_WALKER_NESTED_H @@ -76,10 +76,13 @@ class WalkerNested void write(::zserio::BitStreamWriter& out) const; + size_t bitPosition() const; + private: ::zserio::string<> readText(::zserio::BitStreamReader& in, const allocator_type& allocator); + size_t m_bitPosition; ::zserio::string<> m_text_; }; diff --git a/compiler/extensions/cpp/runtime/test/test_object/std_allocator/WalkerObject.cpp b/compiler/extensions/cpp/runtime/test/test_object/std_allocator/WalkerObject.cpp index 4ddd381e5..799426471 100644 --- a/compiler/extensions/cpp/runtime/test/test_object/std_allocator/WalkerObject.cpp +++ b/compiler/extensions/cpp/runtime/test/test_object/std_allocator/WalkerObject.cpp @@ -1,6 +1,6 @@ /** * Automatically generated by Zserio C++ generator version 1.0.2 using Zserio core 2.14.1. - * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, stdAllocator. + * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, bitPosition, stdAllocator. */ #include @@ -22,6 +22,7 @@ namespace std_allocator WalkerObject::WalkerObject(const allocator_type& allocator) noexcept : m_areChildrenInitialized(false), + m_bitPosition(0), m_identifier_(uint32_t()), m_nested_(::zserio::NullOpt), m_text_(allocator), @@ -34,6 +35,7 @@ WalkerObject::WalkerObject(const allocator_type& allocator) noexcept : WalkerObject::WalkerObject(::zserio::BitStreamReader& in, const allocator_type& allocator) : m_areChildrenInitialized(true), + m_bitPosition(in.getBitPosition()), m_identifier_(readIdentifier(in)), m_nested_(readNested(in, allocator)), m_text_(readText(in, allocator)), @@ -45,6 +47,7 @@ WalkerObject::WalkerObject(::zserio::BitStreamReader& in, const allocator_type& } WalkerObject::WalkerObject(const WalkerObject& other) : + m_bitPosition(other.m_bitPosition), m_identifier_(other.m_identifier_), m_nested_(other.m_nested_), m_text_(other.m_text_), @@ -65,6 +68,7 @@ WalkerObject::WalkerObject(const WalkerObject& other) : WalkerObject& WalkerObject::operator=(const WalkerObject& other) { + m_bitPosition = other.m_bitPosition; m_identifier_ = other.m_identifier_; m_nested_ = other.m_nested_; m_text_ = other.m_text_; @@ -85,6 +89,7 @@ WalkerObject& WalkerObject::operator=(const WalkerObject& other) } WalkerObject::WalkerObject(WalkerObject&& other) : + m_bitPosition(other.m_bitPosition), m_identifier_(::std::move(other.m_identifier_)), m_nested_(::std::move(other.m_nested_)), m_text_(::std::move(other.m_text_)), @@ -105,6 +110,7 @@ WalkerObject::WalkerObject(WalkerObject&& other) : WalkerObject& WalkerObject::operator=(WalkerObject&& other) { + m_bitPosition = other.m_bitPosition; m_identifier_ = ::std::move(other.m_identifier_); m_nested_ = ::std::move(other.m_nested_); m_text_ = ::std::move(other.m_text_); @@ -126,6 +132,7 @@ WalkerObject& WalkerObject::operator=(WalkerObject&& other) WalkerObject::WalkerObject(::zserio::PropagateAllocatorT, const WalkerObject& other, const allocator_type& allocator) : + m_bitPosition(other.m_bitPosition), m_identifier_(::zserio::allocatorPropagatingCopy(other.m_identifier_, allocator)), m_nested_(::zserio::allocatorPropagatingCopy(other.m_nested_, allocator)), m_text_(::zserio::allocatorPropagatingCopy(other.m_text_, allocator)), @@ -357,6 +364,11 @@ ::zserio::IReflectableConstPtr WalkerObject::reflectable(const allocator_type& a return ::zserio::AnyHolder<>(::std::cref(m_object), alloc); } + size_t bitPosition() const override + { + return m_object.bitPosition(); + } + private: const ::test_object::std_allocator::WalkerObject& m_object; }; @@ -583,6 +595,11 @@ ::zserio::IReflectablePtr WalkerObject::reflectable(const allocator_type& alloca return ::zserio::AnyHolder<>(::std::ref(m_object), alloc); } + size_t bitPosition() const override + { + return m_object.bitPosition(); + } + private: ::test_object::std_allocator::WalkerObject& m_object; }; @@ -704,7 +721,7 @@ void WalkerObject::setOptionalUnionArray(::zserio::vector<::test_object::std_all bool WalkerObject::isOptionalUnionArrayUsed() const { - return (isOptionalUnionArraySet()); + return (m_optionalUnionArray_.hasValue()); } bool WalkerObject::isOptionalUnionArraySet() const @@ -759,7 +776,7 @@ size_t WalkerObject::bitSizeOf(size_t bitPosition) const endBitPosition += ::zserio::bitSizeOfString(m_text_); endBitPosition += m_unionArray_.bitSizeOf(*this, endBitPosition); endBitPosition += 1; - if (isOptionalUnionArraySet()) + if (m_optionalUnionArray_.hasValue()) { endBitPosition += m_optionalUnionArray_.value().bitSizeOf(*this, endBitPosition); } @@ -781,7 +798,7 @@ size_t WalkerObject::initializeOffsets(size_t bitPosition) endBitPosition += ::zserio::bitSizeOfString(m_text_); endBitPosition = m_unionArray_.initializeOffsets(*this, endBitPosition); endBitPosition += 1; - if (isOptionalUnionArraySet()) + if (m_optionalUnionArray_.hasValue()) { endBitPosition = m_optionalUnionArray_.value().initializeOffsets(*this, endBitPosition); } @@ -924,7 +941,7 @@ void WalkerObject::write(::zserio::BitStreamWriter& out) const m_unionArray_.write(*this, out); - if (isOptionalUnionArraySet()) + if (m_optionalUnionArray_.hasValue()) { out.writeBool(true); m_optionalUnionArray_.value().write(*this, out); @@ -945,6 +962,11 @@ void WalkerObject::write(::zserio::BitStreamWriter& out) const m_choiceField_.write(out); } +size_t WalkerObject::bitPosition() const +{ + return m_bitPosition; +} + void WalkerObject::ZserioElementFactory_unionArray::create(WalkerObject&, ::zserio::vector<::test_object::std_allocator::WalkerUnion>& array, ::zserio::BitStreamReader& in, size_t) diff --git a/compiler/extensions/cpp/runtime/test/test_object/std_allocator/WalkerObject.h b/compiler/extensions/cpp/runtime/test/test_object/std_allocator/WalkerObject.h index 4916037f4..ae82c9503 100644 --- a/compiler/extensions/cpp/runtime/test/test_object/std_allocator/WalkerObject.h +++ b/compiler/extensions/cpp/runtime/test/test_object/std_allocator/WalkerObject.h @@ -1,6 +1,6 @@ /** * Automatically generated by Zserio C++ generator version 1.0.2 using Zserio core 2.14.1. - * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, stdAllocator. + * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, bitPosition, stdAllocator. */ #ifndef TEST_OBJECT_STD_ALLOCATOR_WALKER_OBJECT_H @@ -133,6 +133,8 @@ class WalkerObject void write(::zserio::BitStreamWriter& out) const; + size_t bitPosition() const; + private: class ZserioElementFactory_unionArray { @@ -171,6 +173,7 @@ class WalkerObject const allocator_type& allocator); bool m_areChildrenInitialized; + size_t m_bitPosition; uint32_t m_identifier_; ::zserio::InplaceOptionalHolder<::test_object::std_allocator::WalkerNested> m_nested_; ::zserio::string<> m_text_; diff --git a/compiler/extensions/cpp/runtime/test/test_object/std_allocator/WalkerUnion.cpp b/compiler/extensions/cpp/runtime/test/test_object/std_allocator/WalkerUnion.cpp index 3dea5058b..a265c6dd3 100644 --- a/compiler/extensions/cpp/runtime/test/test_object/std_allocator/WalkerUnion.cpp +++ b/compiler/extensions/cpp/runtime/test/test_object/std_allocator/WalkerUnion.cpp @@ -1,6 +1,6 @@ /** * Automatically generated by Zserio C++ generator version 1.0.2 using Zserio core 2.14.1. - * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, stdAllocator. + * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, bitPosition, stdAllocator. */ #include @@ -20,12 +20,14 @@ namespace std_allocator { WalkerUnion::WalkerUnion(const allocator_type& allocator) noexcept : + m_bitPosition(0), m_choiceTag(UNDEFINED_CHOICE), m_objectChoice(allocator) { } WalkerUnion::WalkerUnion(::zserio::BitStreamReader& in, const allocator_type& allocator) : + m_bitPosition(in.getBitPosition()), m_choiceTag(readChoiceTag(in)), m_objectChoice(readObject(in, allocator)) { @@ -33,6 +35,7 @@ WalkerUnion::WalkerUnion(::zserio::BitStreamReader& in, const allocator_type& al WalkerUnion::WalkerUnion(::zserio::PropagateAllocatorT, const WalkerUnion& other, const allocator_type& allocator) : + m_bitPosition(other.m_bitPosition), m_choiceTag(other.m_choiceTag), m_objectChoice(::zserio::NoInit, other.copyObject(allocator)) { @@ -173,6 +176,11 @@ ::zserio::IReflectableConstPtr WalkerUnion::reflectable(const allocator_type& al return ::zserio::AnyHolder<>(::std::cref(m_object), alloc); } + size_t bitPosition() const override + { + return m_object.bitPosition(); + } + private: const ::test_object::std_allocator::WalkerUnion& m_object; }; @@ -309,6 +317,11 @@ ::zserio::IReflectablePtr WalkerUnion::reflectable(const allocator_type& allocat return ::zserio::AnyHolder<>(::std::ref(m_object), alloc); } + size_t bitPosition() const override + { + return m_object.bitPosition(); + } + private: ::test_object::std_allocator::WalkerUnion& m_object; }; @@ -551,6 +564,11 @@ void WalkerUnion::write(::zserio::BitStreamWriter& out) const } } +size_t WalkerUnion::bitPosition() const +{ + return m_bitPosition; +} + void WalkerUnion::ZserioElementFactory_nestedArray::create(WalkerUnion&, ::zserio::vector<::test_object::std_allocator::WalkerNested>& array, ::zserio::BitStreamReader& in, size_t) diff --git a/compiler/extensions/cpp/runtime/test/test_object/std_allocator/WalkerUnion.h b/compiler/extensions/cpp/runtime/test/test_object/std_allocator/WalkerUnion.h index 397386547..6a91282e4 100644 --- a/compiler/extensions/cpp/runtime/test/test_object/std_allocator/WalkerUnion.h +++ b/compiler/extensions/cpp/runtime/test/test_object/std_allocator/WalkerUnion.h @@ -1,6 +1,6 @@ /** * Automatically generated by Zserio C++ generator version 1.0.2 using Zserio core 2.14.1. - * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, stdAllocator. + * Generator setup: writerCode, pubsubCode, serviceCode, sqlCode, typeInfoCode, reflectionCode, bitPosition, stdAllocator. */ #ifndef TEST_OBJECT_STD_ALLOCATOR_WALKER_UNION_H @@ -90,6 +90,8 @@ class WalkerUnion void write(::zserio::BitStreamWriter& out) const; + size_t bitPosition() const; + private: class ZserioElementFactory_nestedArray { @@ -107,6 +109,7 @@ class WalkerUnion ::zserio::AnyHolder<> readObject(::zserio::BitStreamReader& in, const allocator_type& allocator); ::zserio::AnyHolder<> copyObject(const allocator_type& allocator) const; + size_t m_bitPosition; ChoiceTag m_choiceTag; ::zserio::AnyHolder<> m_objectChoice; }; diff --git a/compiler/extensions/cpp/runtime/test/test_object/test_object.zs b/compiler/extensions/cpp/runtime/test/test_object/test_object.zs index 344209a3e..57c6094d4 100644 --- a/compiler/extensions/cpp/runtime/test/test_object/test_object.zs +++ b/compiler/extensions/cpp/runtime/test/test_object/test_object.zs @@ -2,9 +2,9 @@ * Compiled twice from the 'test' directory using the following command line options: * * 1. -src test_object test_object.zs -cpp . -withTypeInfoCode -withReflectionCode -withoutSourcesAmalgamation - * -setCppAllocator std -setTopLevelPackage test_object.std_allocator + * -withBitPositionCode -setCppAllocator std -setTopLevelPackage test_object.std_allocator * 2. -src test_object test_object.zs -cpp . -withTypeInfoCode -withReflectionCode -withoutSourcesAmalgamation - * -setCppAllocator polymorphic -setTopLevelPackage test_object.polymorphic_allocator + * -withBitPositionCode -setCppAllocator polymorphic -setTopLevelPackage test_object.polymorphic_allocator */ enum int8 CreatorEnum diff --git a/compiler/extensions/cpp/runtime/test/zserio/ReflectableTest.cpp b/compiler/extensions/cpp/runtime/test/zserio/ReflectableTest.cpp index f17a8b4cc..3c513df80 100644 --- a/compiler/extensions/cpp/runtime/test/zserio/ReflectableTest.cpp +++ b/compiler/extensions/cpp/runtime/test/zserio/ReflectableTest.cpp @@ -1900,6 +1900,8 @@ TEST_F(ReflectableTest, defaultUnimplementedMethods) const Reflectable& constReflectableRef = reflectable; ASSERT_THROW(constReflectableRef.getAnyValue(), CppRuntimeException); + + ASSERT_THROW(reflectable.bitPosition(), CppRuntimeException); } TEST_F(ReflectableTest, reflectableOwner) @@ -1977,6 +1979,9 @@ TEST_F(ReflectableTest, reflectableOwner) BitStreamWriter writer(bitBuffer); reflectable->write(writer); ASSERT_EQ(bitSizeOfValue, writer.getBitPosition()); + + const size_t bitPosition = reflectable->bitPosition(); + ASSERT_EQ(0, bitPosition); } } // namespace zserio diff --git a/scripts/update_test_objects.sh b/scripts/update_test_objects.sh index 02f56fab5..5dda39a25 100755 --- a/scripts/update_test_objects.sh +++ b/scripts/update_test_objects.sh @@ -22,7 +22,7 @@ update_cpp_test_objects() rm -rf "${CPP_RUNTIME_TEST_OBJECT_DIR}/std_allocator" fi local ZSERIO_ARGS_BASE=("-cpp" "${CPP_RUNTIME_TEST_DIR}" - "-withTypeInfoCode" "-withReflectionCode" "-withoutSourcesAmalgamation") + "-withTypeInfoCode" "-withReflectionCode" "-withoutSourcesAmalgamation" "-withBitPositionCode") local SWITCH_WERROR=1 local ZSERIO_ARGS_STD=(${ZSERIO_ARGS_BASE[@]} "-setCppAllocator" "std"