diff --git a/examples/cpp/dds/AdvancedConfigurationExample/HelloWorld.cxx b/examples/cpp/dds/AdvancedConfigurationExample/HelloWorld.cxx index 775eb64924c..a418f049a9b 100644 --- a/examples/cpp/dds/AdvancedConfigurationExample/HelloWorld.cxx +++ b/examples/cpp/dds/AdvancedConfigurationExample/HelloWorld.cxx @@ -34,11 +34,14 @@ using namespace eprosima::fastcdr::exception; #include +#define HelloWorld_max_cdr_typesize 25ULL; +#define HelloWorld_max_key_cdr_typesize 0ULL; + HelloWorld::HelloWorld() { - // m_index com.eprosima.idl.parser.typecode.PrimitiveTypeCode@2b552920 + // unsigned long m_index m_index = 0; - // m_message com.eprosima.idl.parser.typecode.ArrayTypeCode@1f36e637 + // char m_message memset(&m_message, 0, (20) * 1); } @@ -57,7 +60,7 @@ HelloWorld::HelloWorld( } HelloWorld::HelloWorld( - HelloWorld&& x) noexcept + HelloWorld&& x) noexcept { m_index = x.m_index; m_message = std::move(x.m_message); @@ -99,17 +102,8 @@ bool HelloWorld::operator !=( size_t HelloWorld::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += ((20) * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return HelloWorld_max_cdr_typesize; } size_t HelloWorld::getCdrSerializedSize( @@ -214,16 +208,12 @@ std::array& HelloWorld::message() return m_message; } + size_t HelloWorld::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - - - return current_align; + static_cast(current_alignment); + return HelloWorld_max_key_cdr_typesize; } bool HelloWorld::isKeyDefined() @@ -235,5 +225,4 @@ void HelloWorld::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - } diff --git a/examples/cpp/dds/AdvancedConfigurationExample/HelloWorld.h b/examples/cpp/dds/AdvancedConfigurationExample/HelloWorld.h index d714752bded..8128c8677a6 100644 --- a/examples/cpp/dds/AdvancedConfigurationExample/HelloWorld.h +++ b/examples/cpp/dds/AdvancedConfigurationExample/HelloWorld.h @@ -169,11 +169,11 @@ class HelloWorld eProsima_user_DllExport std::array& message(); /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -229,6 +229,7 @@ class HelloWorld uint32_t m_index; std::array m_message; + }; #endif // _FAST_DDS_GENERATED_HELLOWORLD_H_ \ No newline at end of file diff --git a/examples/cpp/dds/BasicConfigurationExample/HelloWorld.cxx b/examples/cpp/dds/BasicConfigurationExample/HelloWorld.cxx index 775eb64924c..a418f049a9b 100644 --- a/examples/cpp/dds/BasicConfigurationExample/HelloWorld.cxx +++ b/examples/cpp/dds/BasicConfigurationExample/HelloWorld.cxx @@ -34,11 +34,14 @@ using namespace eprosima::fastcdr::exception; #include +#define HelloWorld_max_cdr_typesize 25ULL; +#define HelloWorld_max_key_cdr_typesize 0ULL; + HelloWorld::HelloWorld() { - // m_index com.eprosima.idl.parser.typecode.PrimitiveTypeCode@2b552920 + // unsigned long m_index m_index = 0; - // m_message com.eprosima.idl.parser.typecode.ArrayTypeCode@1f36e637 + // char m_message memset(&m_message, 0, (20) * 1); } @@ -57,7 +60,7 @@ HelloWorld::HelloWorld( } HelloWorld::HelloWorld( - HelloWorld&& x) noexcept + HelloWorld&& x) noexcept { m_index = x.m_index; m_message = std::move(x.m_message); @@ -99,17 +102,8 @@ bool HelloWorld::operator !=( size_t HelloWorld::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += ((20) * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return HelloWorld_max_cdr_typesize; } size_t HelloWorld::getCdrSerializedSize( @@ -214,16 +208,12 @@ std::array& HelloWorld::message() return m_message; } + size_t HelloWorld::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - - - return current_align; + static_cast(current_alignment); + return HelloWorld_max_key_cdr_typesize; } bool HelloWorld::isKeyDefined() @@ -235,5 +225,4 @@ void HelloWorld::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - } diff --git a/examples/cpp/dds/BasicConfigurationExample/HelloWorld.h b/examples/cpp/dds/BasicConfigurationExample/HelloWorld.h index d714752bded..8128c8677a6 100644 --- a/examples/cpp/dds/BasicConfigurationExample/HelloWorld.h +++ b/examples/cpp/dds/BasicConfigurationExample/HelloWorld.h @@ -169,11 +169,11 @@ class HelloWorld eProsima_user_DllExport std::array& message(); /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -229,6 +229,7 @@ class HelloWorld uint32_t m_index; std::array m_message; + }; #endif // _FAST_DDS_GENERATED_HELLOWORLD_H_ \ No newline at end of file diff --git a/examples/cpp/dds/Benchmark/Benchmark.cxx b/examples/cpp/dds/Benchmark/Benchmark.cxx index 9367ae1893b..0bd0374e8ef 100644 --- a/examples/cpp/dds/Benchmark/Benchmark.cxx +++ b/examples/cpp/dds/Benchmark/Benchmark.cxx @@ -34,9 +34,12 @@ using namespace eprosima::fastcdr::exception; #include +#define BenchMark_max_cdr_typesize 4ULL; +#define BenchMark_max_key_cdr_typesize 0ULL; + BenchMark::BenchMark() { - // m_index com.eprosima.idl.parser.typecode.PrimitiveTypeCode@610694f1 + // unsigned long m_index m_index = 0; } @@ -91,13 +94,8 @@ bool BenchMark::operator !=( size_t BenchMark::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return BenchMark_max_cdr_typesize; } size_t BenchMark::getCdrSerializedSize( @@ -158,14 +156,12 @@ uint32_t& BenchMark::index() } + size_t BenchMark::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - return current_align; + static_cast(current_alignment); + return BenchMark_max_key_cdr_typesize; } bool BenchMark::isKeyDefined() @@ -177,5 +173,4 @@ void BenchMark::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - } diff --git a/examples/cpp/dds/Benchmark/Benchmark.h b/examples/cpp/dds/Benchmark/Benchmark.h index 870664ec121..ef2bd48179b 100644 --- a/examples/cpp/dds/Benchmark/Benchmark.h +++ b/examples/cpp/dds/Benchmark/Benchmark.h @@ -144,11 +144,11 @@ class BenchMark /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -203,6 +203,7 @@ class BenchMark private: uint32_t m_index; + }; #endif // _FAST_DDS_GENERATED_BENCHMARK_H_ \ No newline at end of file diff --git a/examples/cpp/dds/Benchmark/Benchmark_big.cxx b/examples/cpp/dds/Benchmark/Benchmark_big.cxx index aab194815d2..e9b231cb77b 100644 --- a/examples/cpp/dds/Benchmark/Benchmark_big.cxx +++ b/examples/cpp/dds/Benchmark/Benchmark_big.cxx @@ -34,11 +34,14 @@ using namespace eprosima::fastcdr::exception; #include +#define BenchMarkBig_max_cdr_typesize 8388616ULL; +#define BenchMarkBig_max_key_cdr_typesize 0ULL; + BenchMarkBig::BenchMarkBig() { - // m_data com.eprosima.idl.parser.typecode.ArrayTypeCode@2b552920 + // char m_data memset(&m_data, 0, (8388608) * 1); - // m_index com.eprosima.idl.parser.typecode.PrimitiveTypeCode@1f36e637 + // unsigned long m_index m_index = 0; } @@ -57,7 +60,7 @@ BenchMarkBig::BenchMarkBig( } BenchMarkBig::BenchMarkBig( - BenchMarkBig&& x) noexcept + BenchMarkBig&& x) noexcept { m_data = std::move(x.m_data); m_index = x.m_index; @@ -99,17 +102,8 @@ bool BenchMarkBig::operator !=( size_t BenchMarkBig::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += ((8388608) * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return BenchMarkBig_max_cdr_typesize; } size_t BenchMarkBig::getCdrSerializedSize( @@ -214,16 +208,12 @@ uint32_t& BenchMarkBig::index() } + size_t BenchMarkBig::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - - - return current_align; + static_cast(current_alignment); + return BenchMarkBig_max_key_cdr_typesize; } bool BenchMarkBig::isKeyDefined() @@ -235,5 +225,4 @@ void BenchMarkBig::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - } diff --git a/examples/cpp/dds/Benchmark/Benchmark_big.h b/examples/cpp/dds/Benchmark/Benchmark_big.h index 03dc2ae2519..1e344f47b02 100644 --- a/examples/cpp/dds/Benchmark/Benchmark_big.h +++ b/examples/cpp/dds/Benchmark/Benchmark_big.h @@ -169,11 +169,11 @@ class BenchMarkBig /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -229,6 +229,7 @@ class BenchMarkBig std::array m_data; uint32_t m_index; + }; #endif // _FAST_DDS_GENERATED_BENCHMARK_BIG_H_ \ No newline at end of file diff --git a/examples/cpp/dds/Benchmark/Benchmark_medium.cxx b/examples/cpp/dds/Benchmark/Benchmark_medium.cxx index b28e98a9b09..66f7c261f16 100644 --- a/examples/cpp/dds/Benchmark/Benchmark_medium.cxx +++ b/examples/cpp/dds/Benchmark/Benchmark_medium.cxx @@ -34,11 +34,14 @@ using namespace eprosima::fastcdr::exception; #include +#define BenchMarkMedium_max_cdr_typesize 524296ULL; +#define BenchMarkMedium_max_key_cdr_typesize 0ULL; + BenchMarkMedium::BenchMarkMedium() { - // m_data com.eprosima.idl.parser.typecode.ArrayTypeCode@2b552920 + // char m_data memset(&m_data, 0, (524288) * 1); - // m_index com.eprosima.idl.parser.typecode.PrimitiveTypeCode@1f36e637 + // unsigned long m_index m_index = 0; } @@ -57,7 +60,7 @@ BenchMarkMedium::BenchMarkMedium( } BenchMarkMedium::BenchMarkMedium( - BenchMarkMedium&& x) noexcept + BenchMarkMedium&& x) noexcept { m_data = std::move(x.m_data); m_index = x.m_index; @@ -99,17 +102,8 @@ bool BenchMarkMedium::operator !=( size_t BenchMarkMedium::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += ((524288) * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return BenchMarkMedium_max_cdr_typesize; } size_t BenchMarkMedium::getCdrSerializedSize( @@ -214,16 +208,12 @@ uint32_t& BenchMarkMedium::index() } + size_t BenchMarkMedium::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - - - return current_align; + static_cast(current_alignment); + return BenchMarkMedium_max_key_cdr_typesize; } bool BenchMarkMedium::isKeyDefined() @@ -235,5 +225,4 @@ void BenchMarkMedium::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - } diff --git a/examples/cpp/dds/Benchmark/Benchmark_medium.h b/examples/cpp/dds/Benchmark/Benchmark_medium.h index 23e3f6d2756..e56389f96e9 100644 --- a/examples/cpp/dds/Benchmark/Benchmark_medium.h +++ b/examples/cpp/dds/Benchmark/Benchmark_medium.h @@ -169,11 +169,11 @@ class BenchMarkMedium /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -229,6 +229,7 @@ class BenchMarkMedium std::array m_data; uint32_t m_index; + }; #endif // _FAST_DDS_GENERATED_BENCHMARK_MEDIUM_H_ \ No newline at end of file diff --git a/examples/cpp/dds/Benchmark/Benchmark_small.cxx b/examples/cpp/dds/Benchmark/Benchmark_small.cxx index 004b25dd510..a5845b17a97 100644 --- a/examples/cpp/dds/Benchmark/Benchmark_small.cxx +++ b/examples/cpp/dds/Benchmark/Benchmark_small.cxx @@ -34,11 +34,14 @@ using namespace eprosima::fastcdr::exception; #include +#define BenchMarkSmall_max_cdr_typesize 16392ULL; +#define BenchMarkSmall_max_key_cdr_typesize 0ULL; + BenchMarkSmall::BenchMarkSmall() { - // m_array com.eprosima.idl.parser.typecode.ArrayTypeCode@2b552920 + // char m_array memset(&m_array, 0, (16384) * 1); - // m_index com.eprosima.idl.parser.typecode.PrimitiveTypeCode@1f36e637 + // unsigned long m_index m_index = 0; } @@ -57,7 +60,7 @@ BenchMarkSmall::BenchMarkSmall( } BenchMarkSmall::BenchMarkSmall( - BenchMarkSmall&& x) noexcept + BenchMarkSmall&& x) noexcept { m_array = std::move(x.m_array); m_index = x.m_index; @@ -99,17 +102,8 @@ bool BenchMarkSmall::operator !=( size_t BenchMarkSmall::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += ((16384) * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return BenchMarkSmall_max_cdr_typesize; } size_t BenchMarkSmall::getCdrSerializedSize( @@ -214,16 +208,12 @@ uint32_t& BenchMarkSmall::index() } + size_t BenchMarkSmall::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - - - return current_align; + static_cast(current_alignment); + return BenchMarkSmall_max_key_cdr_typesize; } bool BenchMarkSmall::isKeyDefined() @@ -235,5 +225,4 @@ void BenchMarkSmall::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - } diff --git a/examples/cpp/dds/Benchmark/Benchmark_small.h b/examples/cpp/dds/Benchmark/Benchmark_small.h index f71bb6b7746..86537c53b8c 100644 --- a/examples/cpp/dds/Benchmark/Benchmark_small.h +++ b/examples/cpp/dds/Benchmark/Benchmark_small.h @@ -169,11 +169,11 @@ class BenchMarkSmall /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -229,6 +229,7 @@ class BenchMarkSmall std::array m_array; uint32_t m_index; + }; #endif // _FAST_DDS_GENERATED_BENCHMARK_SMALL_H_ \ No newline at end of file diff --git a/examples/cpp/dds/Configurability/sample.cxx b/examples/cpp/dds/Configurability/sample.cxx index 9f80806c2bc..155c175abbe 100644 --- a/examples/cpp/dds/Configurability/sample.cxx +++ b/examples/cpp/dds/Configurability/sample.cxx @@ -34,11 +34,14 @@ using namespace eprosima::fastcdr::exception; #include +#define sample_max_cdr_typesize 2ULL; +#define sample_max_key_cdr_typesize 1ULL; + sample::sample() { - // m_index com.eprosima.idl.parser.typecode.PrimitiveTypeCode@9a7504c + // octet m_index m_index = 0; - // m_key_value com.eprosima.idl.parser.typecode.PrimitiveTypeCode@587d1d39 + // octet m_key_value m_key_value = 0; } @@ -99,17 +102,8 @@ bool sample::operator !=( size_t sample::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return sample_max_cdr_typesize; } size_t sample::getCdrSerializedSize( @@ -204,18 +198,12 @@ uint8_t& sample::key_value() } + size_t sample::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - current_align += 1 + eprosima::fastcdr::Cdr::alignment(current_align, 1); - - - - return current_align; + static_cast(current_alignment); + return sample_max_key_cdr_typesize; } bool sample::isKeyDefined() @@ -227,6 +215,7 @@ void sample::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - scdr << m_key_value; - + + scdr << m_key_value; + } diff --git a/examples/cpp/dds/Configurability/sample.h b/examples/cpp/dds/Configurability/sample.h index 624761a6ba0..59fbe9969a8 100644 --- a/examples/cpp/dds/Configurability/sample.h +++ b/examples/cpp/dds/Configurability/sample.h @@ -163,11 +163,11 @@ class sample /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -223,6 +223,7 @@ class sample uint8_t m_index; uint8_t m_key_value; + }; #endif // _FAST_DDS_GENERATED_SAMPLE_H_ \ No newline at end of file diff --git a/examples/cpp/dds/ContentFilteredTopicExample/HelloWorld.cxx b/examples/cpp/dds/ContentFilteredTopicExample/HelloWorld.cxx index 7a63cee553b..b7cf46c0895 100644 --- a/examples/cpp/dds/ContentFilteredTopicExample/HelloWorld.cxx +++ b/examples/cpp/dds/ContentFilteredTopicExample/HelloWorld.cxx @@ -35,11 +35,14 @@ using namespace eprosima::fastcdr::exception; #include +#define HelloWorld_max_cdr_typesize 264ULL; +#define HelloWorld_max_key_cdr_typesize 0ULL; + HelloWorld::HelloWorld() { - // m_index com.eprosima.idl.parser.typecode.PrimitiveTypeCode@74a10858 + // unsigned long m_index m_index = 0; - // m_message com.eprosima.idl.parser.typecode.StringTypeCode@23fe1d71 + // string m_message m_message =""; // Just to register all known types @@ -102,16 +105,8 @@ bool HelloWorld::operator !=( size_t HelloWorld::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + 255 + 1; - - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return HelloWorld_max_cdr_typesize; } size_t HelloWorld::getCdrSerializedSize( @@ -214,16 +209,12 @@ std::string& HelloWorld::message() return m_message; } + size_t HelloWorld::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - - - return current_align; + static_cast(current_alignment); + return HelloWorld_max_key_cdr_typesize; } bool HelloWorld::isKeyDefined() @@ -235,5 +226,4 @@ void HelloWorld::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - } diff --git a/examples/cpp/dds/ContentFilteredTopicExample/HelloWorld.h b/examples/cpp/dds/ContentFilteredTopicExample/HelloWorld.h index 6c4b845774e..3bd5ef9124c 100644 --- a/examples/cpp/dds/ContentFilteredTopicExample/HelloWorld.h +++ b/examples/cpp/dds/ContentFilteredTopicExample/HelloWorld.h @@ -169,11 +169,11 @@ class HelloWorld eProsima_user_DllExport std::string& message(); /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -229,6 +229,7 @@ class HelloWorld uint32_t m_index; std::string m_message; + }; #endif // _FAST_DDS_GENERATED_HELLOWORLD_H_ \ No newline at end of file diff --git a/examples/cpp/dds/CustomListenerExample/Topic.cxx b/examples/cpp/dds/CustomListenerExample/Topic.cxx index b99b6be8294..0cec9d60095 100644 --- a/examples/cpp/dds/CustomListenerExample/Topic.cxx +++ b/examples/cpp/dds/CustomListenerExample/Topic.cxx @@ -34,11 +34,14 @@ using namespace eprosima::fastcdr::exception; #include +#define Topic_max_cdr_typesize 264ULL; +#define Topic_max_key_cdr_typesize 0ULL; + Topic::Topic() { - // m_index com.eprosima.idl.parser.typecode.PrimitiveTypeCode@627551fb + // unsigned long m_index m_index = 0; - // m_message com.eprosima.idl.parser.typecode.StringTypeCode@2758fe70 + // string m_message m_message =""; } @@ -99,16 +102,8 @@ bool Topic::operator !=( size_t Topic::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + 255 + 1; - - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return Topic_max_cdr_typesize; } size_t Topic::getCdrSerializedSize( @@ -211,16 +206,12 @@ std::string& Topic::message() return m_message; } + size_t Topic::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - - - return current_align; + static_cast(current_alignment); + return Topic_max_key_cdr_typesize; } bool Topic::isKeyDefined() @@ -232,5 +223,4 @@ void Topic::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - } diff --git a/examples/cpp/dds/CustomListenerExample/Topic.h b/examples/cpp/dds/CustomListenerExample/Topic.h index 04f2c553ac0..eab9d32470c 100644 --- a/examples/cpp/dds/CustomListenerExample/Topic.h +++ b/examples/cpp/dds/CustomListenerExample/Topic.h @@ -169,11 +169,11 @@ class Topic eProsima_user_DllExport std::string& message(); /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -229,6 +229,7 @@ class Topic uint32_t m_index; std::string m_message; + }; #endif // _FAST_DDS_GENERATED_TOPIC_H_ \ No newline at end of file diff --git a/examples/cpp/dds/DeadlineQoSExample/deadlinepayload.cxx b/examples/cpp/dds/DeadlineQoSExample/deadlinepayload.cxx index 571c3b31a04..ef2a5cb60df 100644 --- a/examples/cpp/dds/DeadlineQoSExample/deadlinepayload.cxx +++ b/examples/cpp/dds/DeadlineQoSExample/deadlinepayload.cxx @@ -34,11 +34,14 @@ using namespace eprosima::fastcdr::exception; #include +#define HelloMsg_max_cdr_typesize 265ULL; +#define HelloMsg_max_key_cdr_typesize 2ULL; + HelloMsg::HelloMsg() { - // m_deadlinekey com.eprosima.idl.parser.typecode.PrimitiveTypeCode@23d2a7e8 + // unsigned short m_deadlinekey m_deadlinekey = 0; - // m_payload com.eprosima.idl.parser.typecode.StringTypeCode@26a7b76d + // string m_payload m_payload =""; } @@ -99,16 +102,8 @@ bool HelloMsg::operator !=( size_t HelloMsg::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + 256 + 1; - - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return HelloMsg_max_cdr_typesize; } size_t HelloMsg::getCdrSerializedSize( @@ -215,18 +210,12 @@ eprosima::fastrtps::fixed_string<256>& HelloMsg::payload() return m_payload; } + size_t HelloMsg::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - current_align += 2 + eprosima::fastcdr::Cdr::alignment(current_align, 2); - - - - - return current_align; + static_cast(current_alignment); + return HelloMsg_max_key_cdr_typesize; } bool HelloMsg::isKeyDefined() @@ -238,6 +227,7 @@ void HelloMsg::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - scdr << m_deadlinekey; - + scdr << m_deadlinekey; + + } diff --git a/examples/cpp/dds/DeadlineQoSExample/deadlinepayload.h b/examples/cpp/dds/DeadlineQoSExample/deadlinepayload.h index d24b80360df..bbd913af461 100644 --- a/examples/cpp/dds/DeadlineQoSExample/deadlinepayload.h +++ b/examples/cpp/dds/DeadlineQoSExample/deadlinepayload.h @@ -169,11 +169,11 @@ class HelloMsg eProsima_user_DllExport eprosima::fastrtps::fixed_string<256>& payload(); /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -229,6 +229,7 @@ class HelloMsg uint16_t m_deadlinekey; eprosima::fastrtps::fixed_string<256> m_payload; + }; #endif // _FAST_DDS_GENERATED_DEADLINEPAYLOAD_H_ \ No newline at end of file diff --git a/examples/cpp/dds/DisablePositiveACKs/Topic.cxx b/examples/cpp/dds/DisablePositiveACKs/Topic.cxx index b99b6be8294..0cec9d60095 100644 --- a/examples/cpp/dds/DisablePositiveACKs/Topic.cxx +++ b/examples/cpp/dds/DisablePositiveACKs/Topic.cxx @@ -34,11 +34,14 @@ using namespace eprosima::fastcdr::exception; #include +#define Topic_max_cdr_typesize 264ULL; +#define Topic_max_key_cdr_typesize 0ULL; + Topic::Topic() { - // m_index com.eprosima.idl.parser.typecode.PrimitiveTypeCode@627551fb + // unsigned long m_index m_index = 0; - // m_message com.eprosima.idl.parser.typecode.StringTypeCode@2758fe70 + // string m_message m_message =""; } @@ -99,16 +102,8 @@ bool Topic::operator !=( size_t Topic::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + 255 + 1; - - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return Topic_max_cdr_typesize; } size_t Topic::getCdrSerializedSize( @@ -211,16 +206,12 @@ std::string& Topic::message() return m_message; } + size_t Topic::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - - - return current_align; + static_cast(current_alignment); + return Topic_max_key_cdr_typesize; } bool Topic::isKeyDefined() @@ -232,5 +223,4 @@ void Topic::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - } diff --git a/examples/cpp/dds/DisablePositiveACKs/Topic.h b/examples/cpp/dds/DisablePositiveACKs/Topic.h index 04f2c553ac0..eab9d32470c 100644 --- a/examples/cpp/dds/DisablePositiveACKs/Topic.h +++ b/examples/cpp/dds/DisablePositiveACKs/Topic.h @@ -169,11 +169,11 @@ class Topic eProsima_user_DllExport std::string& message(); /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -229,6 +229,7 @@ class Topic uint32_t m_index; std::string m_message; + }; #endif // _FAST_DDS_GENERATED_TOPIC_H_ \ No newline at end of file diff --git a/examples/cpp/dds/Filtering/FilteringExample.cxx b/examples/cpp/dds/Filtering/FilteringExample.cxx index 75b9c9f6170..31f59c62363 100644 --- a/examples/cpp/dds/Filtering/FilteringExample.cxx +++ b/examples/cpp/dds/Filtering/FilteringExample.cxx @@ -34,9 +34,12 @@ using namespace eprosima::fastcdr::exception; #include +#define FilteringExample_max_cdr_typesize 4ULL; +#define FilteringExample_max_key_cdr_typesize 0ULL; + FilteringExample::FilteringExample() { - // m_sampleNumber com.eprosima.idl.parser.typecode.PrimitiveTypeCode@578486a3 + // long m_sampleNumber m_sampleNumber = 0; } @@ -91,13 +94,8 @@ bool FilteringExample::operator !=( size_t FilteringExample::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return FilteringExample_max_cdr_typesize; } size_t FilteringExample::getCdrSerializedSize( @@ -158,14 +156,12 @@ int32_t& FilteringExample::sampleNumber() } + size_t FilteringExample::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - return current_align; + static_cast(current_alignment); + return FilteringExample_max_key_cdr_typesize; } bool FilteringExample::isKeyDefined() @@ -177,5 +173,4 @@ void FilteringExample::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - } diff --git a/examples/cpp/dds/Filtering/FilteringExample.h b/examples/cpp/dds/Filtering/FilteringExample.h index 733c4df4864..8109e427f49 100644 --- a/examples/cpp/dds/Filtering/FilteringExample.h +++ b/examples/cpp/dds/Filtering/FilteringExample.h @@ -144,11 +144,11 @@ class FilteringExample /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -203,6 +203,7 @@ class FilteringExample private: int32_t m_sampleNumber; + }; #endif // _FAST_DDS_GENERATED_FILTERINGEXAMPLE_H_ \ No newline at end of file diff --git a/examples/cpp/dds/FlowControlExample/FlowControlExample.cxx b/examples/cpp/dds/FlowControlExample/FlowControlExample.cxx index 889c4211553..60dec03784c 100644 --- a/examples/cpp/dds/FlowControlExample/FlowControlExample.cxx +++ b/examples/cpp/dds/FlowControlExample/FlowControlExample.cxx @@ -34,11 +34,14 @@ using namespace eprosima::fastcdr::exception; #include +#define FlowControlExample_max_cdr_typesize 600002ULL; +#define FlowControlExample_max_key_cdr_typesize 0ULL; + FlowControlExample::FlowControlExample() { - // m_message com.eprosima.idl.parser.typecode.ArrayTypeCode@5b87ed94 + // char m_message memset(&m_message, 0, (600000) * 1); - // m_wasFast com.eprosima.idl.parser.typecode.PrimitiveTypeCode@5bc79255 + // char m_wasFast m_wasFast = 0; } @@ -57,7 +60,7 @@ FlowControlExample::FlowControlExample( } FlowControlExample::FlowControlExample( - FlowControlExample&& x) noexcept + FlowControlExample&& x) noexcept { m_message = std::move(x.m_message); m_wasFast = x.m_wasFast; @@ -99,17 +102,8 @@ bool FlowControlExample::operator !=( size_t FlowControlExample::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += ((600000) * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return FlowControlExample_max_cdr_typesize; } size_t FlowControlExample::getCdrSerializedSize( @@ -214,16 +208,12 @@ char& FlowControlExample::wasFast() } + size_t FlowControlExample::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - - - return current_align; + static_cast(current_alignment); + return FlowControlExample_max_key_cdr_typesize; } bool FlowControlExample::isKeyDefined() @@ -235,5 +225,4 @@ void FlowControlExample::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - } diff --git a/examples/cpp/dds/FlowControlExample/FlowControlExample.h b/examples/cpp/dds/FlowControlExample/FlowControlExample.h index a96587f779f..16d2a126e16 100644 --- a/examples/cpp/dds/FlowControlExample/FlowControlExample.h +++ b/examples/cpp/dds/FlowControlExample/FlowControlExample.h @@ -169,11 +169,11 @@ class FlowControlExample /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -229,6 +229,7 @@ class FlowControlExample std::array m_message; char m_wasFast; + }; #endif // _FAST_DDS_GENERATED_FLOWCONTROLEXAMPLE_H_ \ No newline at end of file diff --git a/examples/cpp/dds/HelloWorldExample/HelloWorld.cxx b/examples/cpp/dds/HelloWorldExample/HelloWorld.cxx index 4e11cae1662..2180f69905b 100644 --- a/examples/cpp/dds/HelloWorldExample/HelloWorld.cxx +++ b/examples/cpp/dds/HelloWorldExample/HelloWorld.cxx @@ -34,11 +34,14 @@ using namespace eprosima::fastcdr::exception; #include +#define HelloWorld_max_cdr_typesize 264ULL; +#define HelloWorld_max_key_cdr_typesize 0ULL; + HelloWorld::HelloWorld() { - // m_index com.eprosima.idl.parser.typecode.PrimitiveTypeCode@627551fb + // unsigned long m_index m_index = 0; - // m_message com.eprosima.idl.parser.typecode.StringTypeCode@2758fe70 + // string m_message m_message =""; } @@ -99,16 +102,8 @@ bool HelloWorld::operator !=( size_t HelloWorld::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + 255 + 1; - - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return HelloWorld_max_cdr_typesize; } size_t HelloWorld::getCdrSerializedSize( @@ -211,16 +206,12 @@ std::string& HelloWorld::message() return m_message; } + size_t HelloWorld::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - - - return current_align; + static_cast(current_alignment); + return HelloWorld_max_key_cdr_typesize; } bool HelloWorld::isKeyDefined() @@ -232,5 +223,4 @@ void HelloWorld::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - } diff --git a/examples/cpp/dds/HelloWorldExample/HelloWorld.h b/examples/cpp/dds/HelloWorldExample/HelloWorld.h index 6c4b845774e..3bd5ef9124c 100644 --- a/examples/cpp/dds/HelloWorldExample/HelloWorld.h +++ b/examples/cpp/dds/HelloWorldExample/HelloWorld.h @@ -169,11 +169,11 @@ class HelloWorld eProsima_user_DllExport std::string& message(); /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -229,6 +229,7 @@ class HelloWorld uint32_t m_index; std::string m_message; + }; #endif // _FAST_DDS_GENERATED_HELLOWORLD_H_ \ No newline at end of file diff --git a/examples/cpp/dds/HelloWorldExampleDataSharing/HelloWorld.cxx b/examples/cpp/dds/HelloWorldExampleDataSharing/HelloWorld.cxx index 4e11cae1662..2180f69905b 100644 --- a/examples/cpp/dds/HelloWorldExampleDataSharing/HelloWorld.cxx +++ b/examples/cpp/dds/HelloWorldExampleDataSharing/HelloWorld.cxx @@ -34,11 +34,14 @@ using namespace eprosima::fastcdr::exception; #include +#define HelloWorld_max_cdr_typesize 264ULL; +#define HelloWorld_max_key_cdr_typesize 0ULL; + HelloWorld::HelloWorld() { - // m_index com.eprosima.idl.parser.typecode.PrimitiveTypeCode@627551fb + // unsigned long m_index m_index = 0; - // m_message com.eprosima.idl.parser.typecode.StringTypeCode@2758fe70 + // string m_message m_message =""; } @@ -99,16 +102,8 @@ bool HelloWorld::operator !=( size_t HelloWorld::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + 255 + 1; - - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return HelloWorld_max_cdr_typesize; } size_t HelloWorld::getCdrSerializedSize( @@ -211,16 +206,12 @@ std::string& HelloWorld::message() return m_message; } + size_t HelloWorld::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - - - return current_align; + static_cast(current_alignment); + return HelloWorld_max_key_cdr_typesize; } bool HelloWorld::isKeyDefined() @@ -232,5 +223,4 @@ void HelloWorld::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - } diff --git a/examples/cpp/dds/HelloWorldExampleDataSharing/HelloWorld.h b/examples/cpp/dds/HelloWorldExampleDataSharing/HelloWorld.h index 6c4b845774e..3bd5ef9124c 100644 --- a/examples/cpp/dds/HelloWorldExampleDataSharing/HelloWorld.h +++ b/examples/cpp/dds/HelloWorldExampleDataSharing/HelloWorld.h @@ -169,11 +169,11 @@ class HelloWorld eProsima_user_DllExport std::string& message(); /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -229,6 +229,7 @@ class HelloWorld uint32_t m_index; std::string m_message; + }; #endif // _FAST_DDS_GENERATED_HELLOWORLD_H_ \ No newline at end of file diff --git a/examples/cpp/dds/HelloWorldExampleSharedMem/HelloWorld.cxx b/examples/cpp/dds/HelloWorldExampleSharedMem/HelloWorld.cxx index bcc9e696786..deed1d61701 100644 --- a/examples/cpp/dds/HelloWorldExampleSharedMem/HelloWorld.cxx +++ b/examples/cpp/dds/HelloWorldExampleSharedMem/HelloWorld.cxx @@ -34,14 +34,17 @@ using namespace eprosima::fastcdr::exception; #include +#define HelloWorld_max_cdr_typesize 1048841ULL; +#define HelloWorld_max_key_cdr_typesize 0ULL; + HelloWorld::HelloWorld() { - // m_index com.eprosima.idl.parser.typecode.PrimitiveTypeCode@551aa95a + // unsigned long m_index m_index = 0; - // m_message com.eprosima.idl.parser.typecode.StringTypeCode@35d176f7 + // string m_message m_message =""; - // m_data com.eprosima.idl.parser.typecode.ArrayTypeCode@1dfe2924 - memset(&m_data, 0, (1024*1024) * 1); + // char m_data + memset(&m_data, 0, (1048576) * 1); } @@ -61,7 +64,7 @@ HelloWorld::HelloWorld( } HelloWorld::HelloWorld( - HelloWorld&& x) noexcept + HelloWorld&& x) noexcept { m_index = x.m_index; m_message = std::move(x.m_message); @@ -106,19 +109,8 @@ bool HelloWorld::operator !=( size_t HelloWorld::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + 255 + 1; - - current_alignment += ((1024*1024) * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return HelloWorld_max_cdr_typesize; } size_t HelloWorld::getCdrSerializedSize( @@ -134,7 +126,7 @@ size_t HelloWorld::getCdrSerializedSize( current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.message().size() + 1; - current_alignment += ((1024*1024) * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + current_alignment += ((1048576) * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); return current_alignment - initial_alignment; @@ -231,7 +223,7 @@ std::string& HelloWorld::message() * @param _data New value to be copied in member data */ void HelloWorld::data( - const std::array& _data) + const std::array& _data) { m_data = _data; } @@ -241,7 +233,7 @@ void HelloWorld::data( * @param _data New value to be moved in member data */ void HelloWorld::data( - std::array&& _data) + std::array&& _data) { m_data = std::move(_data); } @@ -250,7 +242,7 @@ void HelloWorld::data( * @brief This function returns a constant reference to member data * @return Constant reference to member data */ -const std::array& HelloWorld::data() const +const std::array& HelloWorld::data() const { return m_data; } @@ -259,22 +251,17 @@ const std::array& HelloWorld::data() const * @brief This function returns a reference to member data * @return Reference to member data */ -std::array& HelloWorld::data() +std::array& HelloWorld::data() { return m_data; } + size_t HelloWorld::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - - - - return current_align; + static_cast(current_alignment); + return HelloWorld_max_key_cdr_typesize; } bool HelloWorld::isKeyDefined() @@ -286,5 +273,4 @@ void HelloWorld::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - } diff --git a/examples/cpp/dds/HelloWorldExampleSharedMem/HelloWorld.h b/examples/cpp/dds/HelloWorldExampleSharedMem/HelloWorld.h index f12437791b9..db2539a2f7a 100644 --- a/examples/cpp/dds/HelloWorldExampleSharedMem/HelloWorld.h +++ b/examples/cpp/dds/HelloWorldExampleSharedMem/HelloWorld.h @@ -172,33 +172,33 @@ class HelloWorld * @param _data New value to be copied in member data */ eProsima_user_DllExport void data( - const std::array& _data); + const std::array& _data); /*! * @brief This function moves the value in member data * @param _data New value to be moved in member data */ eProsima_user_DllExport void data( - std::array&& _data); + std::array&& _data); /*! * @brief This function returns a constant reference to member data * @return Constant reference to member data */ - eProsima_user_DllExport const std::array& data() const; + eProsima_user_DllExport const std::array& data() const; /*! * @brief This function returns a reference to member data * @return Reference to member data */ - eProsima_user_DllExport std::array& data(); + eProsima_user_DllExport std::array& data(); /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -254,7 +254,8 @@ class HelloWorld uint32_t m_index; std::string m_message; - std::array m_data; + std::array m_data; + }; #endif // _FAST_DDS_GENERATED_HELLOWORLD_H_ \ No newline at end of file diff --git a/examples/cpp/dds/HelloWorldExampleTCP/HelloWorld.cxx b/examples/cpp/dds/HelloWorldExampleTCP/HelloWorld.cxx index 4e11cae1662..2180f69905b 100644 --- a/examples/cpp/dds/HelloWorldExampleTCP/HelloWorld.cxx +++ b/examples/cpp/dds/HelloWorldExampleTCP/HelloWorld.cxx @@ -34,11 +34,14 @@ using namespace eprosima::fastcdr::exception; #include +#define HelloWorld_max_cdr_typesize 264ULL; +#define HelloWorld_max_key_cdr_typesize 0ULL; + HelloWorld::HelloWorld() { - // m_index com.eprosima.idl.parser.typecode.PrimitiveTypeCode@627551fb + // unsigned long m_index m_index = 0; - // m_message com.eprosima.idl.parser.typecode.StringTypeCode@2758fe70 + // string m_message m_message =""; } @@ -99,16 +102,8 @@ bool HelloWorld::operator !=( size_t HelloWorld::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + 255 + 1; - - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return HelloWorld_max_cdr_typesize; } size_t HelloWorld::getCdrSerializedSize( @@ -211,16 +206,12 @@ std::string& HelloWorld::message() return m_message; } + size_t HelloWorld::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - - - return current_align; + static_cast(current_alignment); + return HelloWorld_max_key_cdr_typesize; } bool HelloWorld::isKeyDefined() @@ -232,5 +223,4 @@ void HelloWorld::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - } diff --git a/examples/cpp/dds/HelloWorldExampleTCP/HelloWorld.h b/examples/cpp/dds/HelloWorldExampleTCP/HelloWorld.h index 6c4b845774e..3bd5ef9124c 100644 --- a/examples/cpp/dds/HelloWorldExampleTCP/HelloWorld.h +++ b/examples/cpp/dds/HelloWorldExampleTCP/HelloWorld.h @@ -169,11 +169,11 @@ class HelloWorld eProsima_user_DllExport std::string& message(); /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -229,6 +229,7 @@ class HelloWorld uint32_t m_index; std::string m_message; + }; #endif // _FAST_DDS_GENERATED_HELLOWORLD_H_ \ No newline at end of file diff --git a/examples/cpp/dds/HistoryKind/sample.cxx b/examples/cpp/dds/HistoryKind/sample.cxx index 9f80806c2bc..155c175abbe 100644 --- a/examples/cpp/dds/HistoryKind/sample.cxx +++ b/examples/cpp/dds/HistoryKind/sample.cxx @@ -34,11 +34,14 @@ using namespace eprosima::fastcdr::exception; #include +#define sample_max_cdr_typesize 2ULL; +#define sample_max_key_cdr_typesize 1ULL; + sample::sample() { - // m_index com.eprosima.idl.parser.typecode.PrimitiveTypeCode@9a7504c + // octet m_index m_index = 0; - // m_key_value com.eprosima.idl.parser.typecode.PrimitiveTypeCode@587d1d39 + // octet m_key_value m_key_value = 0; } @@ -99,17 +102,8 @@ bool sample::operator !=( size_t sample::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return sample_max_cdr_typesize; } size_t sample::getCdrSerializedSize( @@ -204,18 +198,12 @@ uint8_t& sample::key_value() } + size_t sample::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - current_align += 1 + eprosima::fastcdr::Cdr::alignment(current_align, 1); - - - - return current_align; + static_cast(current_alignment); + return sample_max_key_cdr_typesize; } bool sample::isKeyDefined() @@ -227,6 +215,7 @@ void sample::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - scdr << m_key_value; - + + scdr << m_key_value; + } diff --git a/examples/cpp/dds/HistoryKind/sample.h b/examples/cpp/dds/HistoryKind/sample.h index 624761a6ba0..59fbe9969a8 100644 --- a/examples/cpp/dds/HistoryKind/sample.h +++ b/examples/cpp/dds/HistoryKind/sample.h @@ -163,11 +163,11 @@ class sample /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -223,6 +223,7 @@ class sample uint8_t m_index; uint8_t m_key_value; + }; #endif // _FAST_DDS_GENERATED_SAMPLE_H_ \ No newline at end of file diff --git a/examples/cpp/dds/Keys/sample.cxx b/examples/cpp/dds/Keys/sample.cxx index 9f80806c2bc..155c175abbe 100644 --- a/examples/cpp/dds/Keys/sample.cxx +++ b/examples/cpp/dds/Keys/sample.cxx @@ -34,11 +34,14 @@ using namespace eprosima::fastcdr::exception; #include +#define sample_max_cdr_typesize 2ULL; +#define sample_max_key_cdr_typesize 1ULL; + sample::sample() { - // m_index com.eprosima.idl.parser.typecode.PrimitiveTypeCode@9a7504c + // octet m_index m_index = 0; - // m_key_value com.eprosima.idl.parser.typecode.PrimitiveTypeCode@587d1d39 + // octet m_key_value m_key_value = 0; } @@ -99,17 +102,8 @@ bool sample::operator !=( size_t sample::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return sample_max_cdr_typesize; } size_t sample::getCdrSerializedSize( @@ -204,18 +198,12 @@ uint8_t& sample::key_value() } + size_t sample::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - current_align += 1 + eprosima::fastcdr::Cdr::alignment(current_align, 1); - - - - return current_align; + static_cast(current_alignment); + return sample_max_key_cdr_typesize; } bool sample::isKeyDefined() @@ -227,6 +215,7 @@ void sample::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - scdr << m_key_value; - + + scdr << m_key_value; + } diff --git a/examples/cpp/dds/Keys/sample.h b/examples/cpp/dds/Keys/sample.h index 624761a6ba0..59fbe9969a8 100644 --- a/examples/cpp/dds/Keys/sample.h +++ b/examples/cpp/dds/Keys/sample.h @@ -163,11 +163,11 @@ class sample /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -223,6 +223,7 @@ class sample uint8_t m_index; uint8_t m_key_value; + }; #endif // _FAST_DDS_GENERATED_SAMPLE_H_ \ No newline at end of file diff --git a/examples/cpp/dds/LateJoiners/sample.cxx b/examples/cpp/dds/LateJoiners/sample.cxx index 9f80806c2bc..155c175abbe 100644 --- a/examples/cpp/dds/LateJoiners/sample.cxx +++ b/examples/cpp/dds/LateJoiners/sample.cxx @@ -34,11 +34,14 @@ using namespace eprosima::fastcdr::exception; #include +#define sample_max_cdr_typesize 2ULL; +#define sample_max_key_cdr_typesize 1ULL; + sample::sample() { - // m_index com.eprosima.idl.parser.typecode.PrimitiveTypeCode@9a7504c + // octet m_index m_index = 0; - // m_key_value com.eprosima.idl.parser.typecode.PrimitiveTypeCode@587d1d39 + // octet m_key_value m_key_value = 0; } @@ -99,17 +102,8 @@ bool sample::operator !=( size_t sample::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return sample_max_cdr_typesize; } size_t sample::getCdrSerializedSize( @@ -204,18 +198,12 @@ uint8_t& sample::key_value() } + size_t sample::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - current_align += 1 + eprosima::fastcdr::Cdr::alignment(current_align, 1); - - - - return current_align; + static_cast(current_alignment); + return sample_max_key_cdr_typesize; } bool sample::isKeyDefined() @@ -227,6 +215,7 @@ void sample::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - scdr << m_key_value; - + + scdr << m_key_value; + } diff --git a/examples/cpp/dds/LateJoiners/sample.h b/examples/cpp/dds/LateJoiners/sample.h index 624761a6ba0..59fbe9969a8 100644 --- a/examples/cpp/dds/LateJoiners/sample.h +++ b/examples/cpp/dds/LateJoiners/sample.h @@ -163,11 +163,11 @@ class sample /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -223,6 +223,7 @@ class sample uint8_t m_index; uint8_t m_key_value; + }; #endif // _FAST_DDS_GENERATED_SAMPLE_H_ \ No newline at end of file diff --git a/examples/cpp/dds/LifespanQoSExample/Lifespan.cxx b/examples/cpp/dds/LifespanQoSExample/Lifespan.cxx index 0be356526a2..c35f0bfdc22 100644 --- a/examples/cpp/dds/LifespanQoSExample/Lifespan.cxx +++ b/examples/cpp/dds/LifespanQoSExample/Lifespan.cxx @@ -34,11 +34,14 @@ using namespace eprosima::fastcdr::exception; #include +#define Lifespan_max_cdr_typesize 264ULL; +#define Lifespan_max_key_cdr_typesize 0ULL; + Lifespan::Lifespan() { - // m_index com.eprosima.idl.parser.typecode.PrimitiveTypeCode@627551fb + // unsigned long m_index m_index = 0; - // m_message com.eprosima.idl.parser.typecode.StringTypeCode@2758fe70 + // string m_message m_message =""; } @@ -99,16 +102,8 @@ bool Lifespan::operator !=( size_t Lifespan::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + 255 + 1; - - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return Lifespan_max_cdr_typesize; } size_t Lifespan::getCdrSerializedSize( @@ -211,16 +206,12 @@ std::string& Lifespan::message() return m_message; } + size_t Lifespan::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - - - return current_align; + static_cast(current_alignment); + return Lifespan_max_key_cdr_typesize; } bool Lifespan::isKeyDefined() @@ -232,5 +223,4 @@ void Lifespan::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - } diff --git a/examples/cpp/dds/LifespanQoSExample/Lifespan.h b/examples/cpp/dds/LifespanQoSExample/Lifespan.h index 38deb26c942..252ebb85a56 100644 --- a/examples/cpp/dds/LifespanQoSExample/Lifespan.h +++ b/examples/cpp/dds/LifespanQoSExample/Lifespan.h @@ -169,11 +169,11 @@ class Lifespan eProsima_user_DllExport std::string& message(); /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -229,6 +229,7 @@ class Lifespan uint32_t m_index; std::string m_message; + }; #endif // _FAST_DDS_GENERATED_LIFESPAN_H_ \ No newline at end of file diff --git a/examples/cpp/dds/LivelinessQoS/Topic.cxx b/examples/cpp/dds/LivelinessQoS/Topic.cxx index b99b6be8294..0cec9d60095 100644 --- a/examples/cpp/dds/LivelinessQoS/Topic.cxx +++ b/examples/cpp/dds/LivelinessQoS/Topic.cxx @@ -34,11 +34,14 @@ using namespace eprosima::fastcdr::exception; #include +#define Topic_max_cdr_typesize 264ULL; +#define Topic_max_key_cdr_typesize 0ULL; + Topic::Topic() { - // m_index com.eprosima.idl.parser.typecode.PrimitiveTypeCode@627551fb + // unsigned long m_index m_index = 0; - // m_message com.eprosima.idl.parser.typecode.StringTypeCode@2758fe70 + // string m_message m_message =""; } @@ -99,16 +102,8 @@ bool Topic::operator !=( size_t Topic::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + 255 + 1; - - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return Topic_max_cdr_typesize; } size_t Topic::getCdrSerializedSize( @@ -211,16 +206,12 @@ std::string& Topic::message() return m_message; } + size_t Topic::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - - - return current_align; + static_cast(current_alignment); + return Topic_max_key_cdr_typesize; } bool Topic::isKeyDefined() @@ -232,5 +223,4 @@ void Topic::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - } diff --git a/examples/cpp/dds/LivelinessQoS/Topic.h b/examples/cpp/dds/LivelinessQoS/Topic.h index 04f2c553ac0..eab9d32470c 100644 --- a/examples/cpp/dds/LivelinessQoS/Topic.h +++ b/examples/cpp/dds/LivelinessQoS/Topic.h @@ -169,11 +169,11 @@ class Topic eProsima_user_DllExport std::string& message(); /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -229,6 +229,7 @@ class Topic uint32_t m_index; std::string m_message; + }; #endif // _FAST_DDS_GENERATED_TOPIC_H_ \ No newline at end of file diff --git a/examples/cpp/dds/OwnershipStrengthQoSExample/OwnershipStrength.cxx b/examples/cpp/dds/OwnershipStrengthQoSExample/OwnershipStrength.cxx index 4e01620e41a..863f76b8b01 100644 --- a/examples/cpp/dds/OwnershipStrengthQoSExample/OwnershipStrength.cxx +++ b/examples/cpp/dds/OwnershipStrengthQoSExample/OwnershipStrength.cxx @@ -34,13 +34,16 @@ using namespace eprosima::fastcdr::exception; #include +#define ExampleMessage_max_cdr_typesize 268ULL; +#define ExampleMessage_max_key_cdr_typesize 0ULL; + ExampleMessage::ExampleMessage() { - // m_index com.eprosima.idl.parser.typecode.PrimitiveTypeCode@2b552920 + // unsigned long m_index m_index = 0; - // m_ownershipStrength com.eprosima.idl.parser.typecode.PrimitiveTypeCode@2758fe70 + // unsigned long m_ownershipStrength m_ownershipStrength = 0; - // m_message com.eprosima.idl.parser.typecode.StringTypeCode@1f36e637 + // string m_message m_message =""; } @@ -106,19 +109,8 @@ bool ExampleMessage::operator !=( size_t ExampleMessage::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + 255 + 1; - - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return ExampleMessage_max_cdr_typesize; } size_t ExampleMessage::getCdrSerializedSize( @@ -254,17 +246,12 @@ std::string& ExampleMessage::message() return m_message; } + size_t ExampleMessage::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - - - - return current_align; + static_cast(current_alignment); + return ExampleMessage_max_key_cdr_typesize; } bool ExampleMessage::isKeyDefined() @@ -276,5 +263,4 @@ void ExampleMessage::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - } diff --git a/examples/cpp/dds/OwnershipStrengthQoSExample/OwnershipStrength.h b/examples/cpp/dds/OwnershipStrengthQoSExample/OwnershipStrength.h index 23c22e34a51..ac97492226f 100644 --- a/examples/cpp/dds/OwnershipStrengthQoSExample/OwnershipStrength.h +++ b/examples/cpp/dds/OwnershipStrengthQoSExample/OwnershipStrength.h @@ -188,11 +188,11 @@ class ExampleMessage eProsima_user_DllExport std::string& message(); /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -249,6 +249,7 @@ class ExampleMessage uint32_t m_index; uint32_t m_ownershipStrength; std::string m_message; + }; #endif // _FAST_DDS_GENERATED_OWNERSHIPSTRENGTH_H_ \ No newline at end of file diff --git a/examples/cpp/dds/RequestReplyExample/Calculator.cxx b/examples/cpp/dds/RequestReplyExample/Calculator.cxx index d3727ee2fc6..d9a1032e7f9 100644 --- a/examples/cpp/dds/RequestReplyExample/Calculator.cxx +++ b/examples/cpp/dds/RequestReplyExample/Calculator.cxx @@ -35,13 +35,20 @@ using namespace eprosima::fastcdr::exception; #include +#define ReplyType_max_cdr_typesize 8ULL; +#define RequestType_max_cdr_typesize 12ULL; + +#define ReplyType_max_key_cdr_typesize 0ULL; +#define RequestType_max_key_cdr_typesize 0ULL; + + RequestType::RequestType() { - // m_operation com.eprosima.idl.parser.typecode.EnumTypeCode@24b1d79b + // OperationType m_operation m_operation = ::ADDITION; - // m_x com.eprosima.idl.parser.typecode.PrimitiveTypeCode@68ceda24 + // long m_x m_x = 0; - // m_y com.eprosima.idl.parser.typecode.PrimitiveTypeCode@281e3708 + // long m_y m_y = 0; } @@ -107,20 +114,8 @@ bool RequestType::operator !=( size_t RequestType::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return RequestType_max_cdr_typesize; } size_t RequestType::getCdrSerializedSize( @@ -253,17 +248,12 @@ int32_t& RequestType::y() } + size_t RequestType::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - - - - return current_align; + static_cast(current_alignment); + return RequestType_max_key_cdr_typesize; } bool RequestType::isKeyDefined() @@ -275,12 +265,11 @@ void RequestType::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - } ReplyType::ReplyType() { - // m_z com.eprosima.idl.parser.typecode.PrimitiveTypeCode@44a3ec6b + // long long m_z m_z = 0; } @@ -335,13 +324,8 @@ bool ReplyType::operator !=( size_t ReplyType::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return ReplyType_max_cdr_typesize; } size_t ReplyType::getCdrSerializedSize( @@ -402,14 +386,12 @@ int64_t& ReplyType::z() } + size_t ReplyType::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - return current_align; + static_cast(current_alignment); + return ReplyType_max_key_cdr_typesize; } bool ReplyType::isKeyDefined() @@ -421,5 +403,4 @@ void ReplyType::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - } diff --git a/examples/cpp/dds/RequestReplyExample/Calculator.h b/examples/cpp/dds/RequestReplyExample/Calculator.h index 8427052d56c..8bb51b0b562 100644 --- a/examples/cpp/dds/RequestReplyExample/Calculator.h +++ b/examples/cpp/dds/RequestReplyExample/Calculator.h @@ -193,11 +193,11 @@ class RequestType /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -254,6 +254,7 @@ class RequestType OperationType m_operation; int32_t m_x; int32_t m_y; + }; /*! * @brief This class represents the structure ReplyType defined by the user in the IDL file. @@ -336,11 +337,11 @@ class ReplyType /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -395,6 +396,7 @@ class ReplyType private: int64_t m_z; + }; #endif // _FAST_DDS_GENERATED_CALCULATOR_H_ \ No newline at end of file diff --git a/examples/cpp/dds/SampleConfig_Controller/sample.cxx b/examples/cpp/dds/SampleConfig_Controller/sample.cxx index 9f80806c2bc..155c175abbe 100644 --- a/examples/cpp/dds/SampleConfig_Controller/sample.cxx +++ b/examples/cpp/dds/SampleConfig_Controller/sample.cxx @@ -34,11 +34,14 @@ using namespace eprosima::fastcdr::exception; #include +#define sample_max_cdr_typesize 2ULL; +#define sample_max_key_cdr_typesize 1ULL; + sample::sample() { - // m_index com.eprosima.idl.parser.typecode.PrimitiveTypeCode@9a7504c + // octet m_index m_index = 0; - // m_key_value com.eprosima.idl.parser.typecode.PrimitiveTypeCode@587d1d39 + // octet m_key_value m_key_value = 0; } @@ -99,17 +102,8 @@ bool sample::operator !=( size_t sample::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return sample_max_cdr_typesize; } size_t sample::getCdrSerializedSize( @@ -204,18 +198,12 @@ uint8_t& sample::key_value() } + size_t sample::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - current_align += 1 + eprosima::fastcdr::Cdr::alignment(current_align, 1); - - - - return current_align; + static_cast(current_alignment); + return sample_max_key_cdr_typesize; } bool sample::isKeyDefined() @@ -227,6 +215,7 @@ void sample::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - scdr << m_key_value; - + + scdr << m_key_value; + } diff --git a/examples/cpp/dds/SampleConfig_Controller/sample.h b/examples/cpp/dds/SampleConfig_Controller/sample.h index 624761a6ba0..59fbe9969a8 100644 --- a/examples/cpp/dds/SampleConfig_Controller/sample.h +++ b/examples/cpp/dds/SampleConfig_Controller/sample.h @@ -163,11 +163,11 @@ class sample /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -223,6 +223,7 @@ class sample uint8_t m_index; uint8_t m_key_value; + }; #endif // _FAST_DDS_GENERATED_SAMPLE_H_ \ No newline at end of file diff --git a/examples/cpp/dds/SampleConfig_Events/sample.cxx b/examples/cpp/dds/SampleConfig_Events/sample.cxx index 9f80806c2bc..155c175abbe 100644 --- a/examples/cpp/dds/SampleConfig_Events/sample.cxx +++ b/examples/cpp/dds/SampleConfig_Events/sample.cxx @@ -34,11 +34,14 @@ using namespace eprosima::fastcdr::exception; #include +#define sample_max_cdr_typesize 2ULL; +#define sample_max_key_cdr_typesize 1ULL; + sample::sample() { - // m_index com.eprosima.idl.parser.typecode.PrimitiveTypeCode@9a7504c + // octet m_index m_index = 0; - // m_key_value com.eprosima.idl.parser.typecode.PrimitiveTypeCode@587d1d39 + // octet m_key_value m_key_value = 0; } @@ -99,17 +102,8 @@ bool sample::operator !=( size_t sample::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return sample_max_cdr_typesize; } size_t sample::getCdrSerializedSize( @@ -204,18 +198,12 @@ uint8_t& sample::key_value() } + size_t sample::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - current_align += 1 + eprosima::fastcdr::Cdr::alignment(current_align, 1); - - - - return current_align; + static_cast(current_alignment); + return sample_max_key_cdr_typesize; } bool sample::isKeyDefined() @@ -227,6 +215,7 @@ void sample::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - scdr << m_key_value; - + + scdr << m_key_value; + } diff --git a/examples/cpp/dds/SampleConfig_Events/sample.h b/examples/cpp/dds/SampleConfig_Events/sample.h index 624761a6ba0..59fbe9969a8 100644 --- a/examples/cpp/dds/SampleConfig_Events/sample.h +++ b/examples/cpp/dds/SampleConfig_Events/sample.h @@ -163,11 +163,11 @@ class sample /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -223,6 +223,7 @@ class sample uint8_t m_index; uint8_t m_key_value; + }; #endif // _FAST_DDS_GENERATED_SAMPLE_H_ \ No newline at end of file diff --git a/examples/cpp/dds/SampleConfig_Multimedia/sample.cxx b/examples/cpp/dds/SampleConfig_Multimedia/sample.cxx index 9f80806c2bc..155c175abbe 100644 --- a/examples/cpp/dds/SampleConfig_Multimedia/sample.cxx +++ b/examples/cpp/dds/SampleConfig_Multimedia/sample.cxx @@ -34,11 +34,14 @@ using namespace eprosima::fastcdr::exception; #include +#define sample_max_cdr_typesize 2ULL; +#define sample_max_key_cdr_typesize 1ULL; + sample::sample() { - // m_index com.eprosima.idl.parser.typecode.PrimitiveTypeCode@9a7504c + // octet m_index m_index = 0; - // m_key_value com.eprosima.idl.parser.typecode.PrimitiveTypeCode@587d1d39 + // octet m_key_value m_key_value = 0; } @@ -99,17 +102,8 @@ bool sample::operator !=( size_t sample::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return sample_max_cdr_typesize; } size_t sample::getCdrSerializedSize( @@ -204,18 +198,12 @@ uint8_t& sample::key_value() } + size_t sample::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - current_align += 1 + eprosima::fastcdr::Cdr::alignment(current_align, 1); - - - - return current_align; + static_cast(current_alignment); + return sample_max_key_cdr_typesize; } bool sample::isKeyDefined() @@ -227,6 +215,7 @@ void sample::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - scdr << m_key_value; - + + scdr << m_key_value; + } diff --git a/examples/cpp/dds/SampleConfig_Multimedia/sample.h b/examples/cpp/dds/SampleConfig_Multimedia/sample.h index 624761a6ba0..59fbe9969a8 100644 --- a/examples/cpp/dds/SampleConfig_Multimedia/sample.h +++ b/examples/cpp/dds/SampleConfig_Multimedia/sample.h @@ -163,11 +163,11 @@ class sample /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -223,6 +223,7 @@ class sample uint8_t m_index; uint8_t m_key_value; + }; #endif // _FAST_DDS_GENERATED_SAMPLE_H_ \ No newline at end of file diff --git a/examples/cpp/dds/SecureHelloWorldExample/HelloWorld.cxx b/examples/cpp/dds/SecureHelloWorldExample/HelloWorld.cxx index 4e11cae1662..2180f69905b 100644 --- a/examples/cpp/dds/SecureHelloWorldExample/HelloWorld.cxx +++ b/examples/cpp/dds/SecureHelloWorldExample/HelloWorld.cxx @@ -34,11 +34,14 @@ using namespace eprosima::fastcdr::exception; #include +#define HelloWorld_max_cdr_typesize 264ULL; +#define HelloWorld_max_key_cdr_typesize 0ULL; + HelloWorld::HelloWorld() { - // m_index com.eprosima.idl.parser.typecode.PrimitiveTypeCode@627551fb + // unsigned long m_index m_index = 0; - // m_message com.eprosima.idl.parser.typecode.StringTypeCode@2758fe70 + // string m_message m_message =""; } @@ -99,16 +102,8 @@ bool HelloWorld::operator !=( size_t HelloWorld::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + 255 + 1; - - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return HelloWorld_max_cdr_typesize; } size_t HelloWorld::getCdrSerializedSize( @@ -211,16 +206,12 @@ std::string& HelloWorld::message() return m_message; } + size_t HelloWorld::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - - - return current_align; + static_cast(current_alignment); + return HelloWorld_max_key_cdr_typesize; } bool HelloWorld::isKeyDefined() @@ -232,5 +223,4 @@ void HelloWorld::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - } diff --git a/examples/cpp/dds/SecureHelloWorldExample/HelloWorld.h b/examples/cpp/dds/SecureHelloWorldExample/HelloWorld.h index 6c4b845774e..3bd5ef9124c 100644 --- a/examples/cpp/dds/SecureHelloWorldExample/HelloWorld.h +++ b/examples/cpp/dds/SecureHelloWorldExample/HelloWorld.h @@ -169,11 +169,11 @@ class HelloWorld eProsima_user_DllExport std::string& message(); /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -229,6 +229,7 @@ class HelloWorld uint32_t m_index; std::string m_message; + }; #endif // _FAST_DDS_GENERATED_HELLOWORLD_H_ \ No newline at end of file diff --git a/examples/cpp/dds/StaticHelloWorldExample/HelloWorld.cxx b/examples/cpp/dds/StaticHelloWorldExample/HelloWorld.cxx index 4e11cae1662..2180f69905b 100644 --- a/examples/cpp/dds/StaticHelloWorldExample/HelloWorld.cxx +++ b/examples/cpp/dds/StaticHelloWorldExample/HelloWorld.cxx @@ -34,11 +34,14 @@ using namespace eprosima::fastcdr::exception; #include +#define HelloWorld_max_cdr_typesize 264ULL; +#define HelloWorld_max_key_cdr_typesize 0ULL; + HelloWorld::HelloWorld() { - // m_index com.eprosima.idl.parser.typecode.PrimitiveTypeCode@627551fb + // unsigned long m_index m_index = 0; - // m_message com.eprosima.idl.parser.typecode.StringTypeCode@2758fe70 + // string m_message m_message =""; } @@ -99,16 +102,8 @@ bool HelloWorld::operator !=( size_t HelloWorld::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + 255 + 1; - - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return HelloWorld_max_cdr_typesize; } size_t HelloWorld::getCdrSerializedSize( @@ -211,16 +206,12 @@ std::string& HelloWorld::message() return m_message; } + size_t HelloWorld::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - - - return current_align; + static_cast(current_alignment); + return HelloWorld_max_key_cdr_typesize; } bool HelloWorld::isKeyDefined() @@ -232,5 +223,4 @@ void HelloWorld::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - } diff --git a/examples/cpp/dds/StaticHelloWorldExample/HelloWorld.h b/examples/cpp/dds/StaticHelloWorldExample/HelloWorld.h index 6c4b845774e..3bd5ef9124c 100644 --- a/examples/cpp/dds/StaticHelloWorldExample/HelloWorld.h +++ b/examples/cpp/dds/StaticHelloWorldExample/HelloWorld.h @@ -169,11 +169,11 @@ class HelloWorld eProsima_user_DllExport std::string& message(); /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -229,6 +229,7 @@ class HelloWorld uint32_t m_index; std::string m_message; + }; #endif // _FAST_DDS_GENERATED_HELLOWORLD_H_ \ No newline at end of file diff --git a/examples/cpp/dds/WriterLoansExample/LoanableHelloWorld.cxx b/examples/cpp/dds/WriterLoansExample/LoanableHelloWorld.cxx index fa32211d5cc..b548f4d0103 100644 --- a/examples/cpp/dds/WriterLoansExample/LoanableHelloWorld.cxx +++ b/examples/cpp/dds/WriterLoansExample/LoanableHelloWorld.cxx @@ -34,11 +34,14 @@ using namespace eprosima::fastcdr::exception; #include +#define LoanableHelloWorld_max_cdr_typesize 261ULL; +#define LoanableHelloWorld_max_key_cdr_typesize 0ULL; + LoanableHelloWorld::LoanableHelloWorld() { - // m_index com.eprosima.idl.parser.typecode.PrimitiveTypeCode@2b552920 + // unsigned long m_index m_index = 0; - // m_message com.eprosima.idl.parser.typecode.ArrayTypeCode@1f36e637 + // char m_message memset(&m_message, 0, (256) * 1); } @@ -57,7 +60,7 @@ LoanableHelloWorld::LoanableHelloWorld( } LoanableHelloWorld::LoanableHelloWorld( - LoanableHelloWorld&& x) noexcept + LoanableHelloWorld&& x) noexcept { m_index = x.m_index; m_message = std::move(x.m_message); @@ -99,17 +102,8 @@ bool LoanableHelloWorld::operator !=( size_t LoanableHelloWorld::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += ((256) * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return LoanableHelloWorld_max_cdr_typesize; } size_t LoanableHelloWorld::getCdrSerializedSize( @@ -214,16 +208,12 @@ std::array& LoanableHelloWorld::message() return m_message; } + size_t LoanableHelloWorld::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - - - return current_align; + static_cast(current_alignment); + return LoanableHelloWorld_max_key_cdr_typesize; } bool LoanableHelloWorld::isKeyDefined() @@ -235,5 +225,4 @@ void LoanableHelloWorld::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - } diff --git a/examples/cpp/dds/WriterLoansExample/LoanableHelloWorld.h b/examples/cpp/dds/WriterLoansExample/LoanableHelloWorld.h index 9c16828c406..5e5c5ccd284 100644 --- a/examples/cpp/dds/WriterLoansExample/LoanableHelloWorld.h +++ b/examples/cpp/dds/WriterLoansExample/LoanableHelloWorld.h @@ -169,11 +169,11 @@ class LoanableHelloWorld eProsima_user_DllExport std::array& message(); /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -229,6 +229,7 @@ class LoanableHelloWorld uint32_t m_index; std::array m_message; + }; #endif // _FAST_DDS_GENERATED_LOANABLEHELLOWORLD_H_ \ No newline at end of file diff --git a/examples/cpp/dds/ZeroCopyExample/LoanableHelloWorld.cxx b/examples/cpp/dds/ZeroCopyExample/LoanableHelloWorld.cxx index fa32211d5cc..b548f4d0103 100644 --- a/examples/cpp/dds/ZeroCopyExample/LoanableHelloWorld.cxx +++ b/examples/cpp/dds/ZeroCopyExample/LoanableHelloWorld.cxx @@ -34,11 +34,14 @@ using namespace eprosima::fastcdr::exception; #include +#define LoanableHelloWorld_max_cdr_typesize 261ULL; +#define LoanableHelloWorld_max_key_cdr_typesize 0ULL; + LoanableHelloWorld::LoanableHelloWorld() { - // m_index com.eprosima.idl.parser.typecode.PrimitiveTypeCode@2b552920 + // unsigned long m_index m_index = 0; - // m_message com.eprosima.idl.parser.typecode.ArrayTypeCode@1f36e637 + // char m_message memset(&m_message, 0, (256) * 1); } @@ -57,7 +60,7 @@ LoanableHelloWorld::LoanableHelloWorld( } LoanableHelloWorld::LoanableHelloWorld( - LoanableHelloWorld&& x) noexcept + LoanableHelloWorld&& x) noexcept { m_index = x.m_index; m_message = std::move(x.m_message); @@ -99,17 +102,8 @@ bool LoanableHelloWorld::operator !=( size_t LoanableHelloWorld::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += ((256) * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return LoanableHelloWorld_max_cdr_typesize; } size_t LoanableHelloWorld::getCdrSerializedSize( @@ -214,16 +208,12 @@ std::array& LoanableHelloWorld::message() return m_message; } + size_t LoanableHelloWorld::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - - - return current_align; + static_cast(current_alignment); + return LoanableHelloWorld_max_key_cdr_typesize; } bool LoanableHelloWorld::isKeyDefined() @@ -235,5 +225,4 @@ void LoanableHelloWorld::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - } diff --git a/examples/cpp/dds/ZeroCopyExample/LoanableHelloWorld.h b/examples/cpp/dds/ZeroCopyExample/LoanableHelloWorld.h index 9c16828c406..5e5c5ccd284 100644 --- a/examples/cpp/dds/ZeroCopyExample/LoanableHelloWorld.h +++ b/examples/cpp/dds/ZeroCopyExample/LoanableHelloWorld.h @@ -169,11 +169,11 @@ class LoanableHelloWorld eProsima_user_DllExport std::array& message(); /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -229,6 +229,7 @@ class LoanableHelloWorld uint32_t m_index; std::array m_message; + }; #endif // _FAST_DDS_GENERATED_LOANABLEHELLOWORLD_H_ \ No newline at end of file diff --git a/src/cpp/statistics/types/types.cxx b/src/cpp/statistics/types/types.cxx index 2ca5610a2e1..5a91c4242cd 100644 --- a/src/cpp/statistics/types/types.cxx +++ b/src/cpp/statistics/types/types.cxx @@ -34,9 +34,42 @@ using namespace eprosima::fastcdr::exception; #include +#define eprosima_fastdds_statistics_DiscoveryTime_max_cdr_typesize 828ULL; +#define eprosima_fastdds_statistics_PhysicalData_max_cdr_typesize 800ULL; + +#define eprosima_fastdds_statistics_detail_Locator_s_max_cdr_typesize 25ULL; + +#define eprosima_fastdds_statistics_detail_GuidPrefix_s_max_cdr_typesize 13ULL; +#define eprosima_fastdds_statistics_detail_SampleIdentity_s_max_cdr_typesize 28ULL; +#define eprosima_fastdds_statistics_EntityData_max_cdr_typesize 24ULL; +#define eprosima_fastdds_statistics_Entity2LocatorTraffic_max_cdr_typesize 66ULL; +#define eprosima_fastdds_statistics_detail_EntityId_s_max_cdr_typesize 5ULL; +#define eprosima_fastdds_statistics_EntityCount_max_cdr_typesize 32ULL; +#define eprosima_fastdds_statistics_WriterReaderData_max_cdr_typesize 40ULL; +#define eprosima_fastdds_statistics_SampleIdentityCount_max_cdr_typesize 40ULL; +#define eprosima_fastdds_statistics_Locator2LocatorData_max_cdr_typesize 60ULL; +#define eprosima_fastdds_statistics_detail_GUID_s_max_cdr_typesize 18ULL; +#define eprosima_fastdds_statistics_detail_SequenceNumber_s_max_cdr_typesize 8ULL; +#define eprosima_fastdds_statistics_DiscoveryTime_max_key_cdr_typesize 36ULL; +#define eprosima_fastdds_statistics_PhysicalData_max_key_cdr_typesize 18ULL; + +#define eprosima_fastdds_statistics_detail_Locator_s_max_key_cdr_typesize 0ULL; + +#define eprosima_fastdds_statistics_detail_GuidPrefix_s_max_key_cdr_typesize 0ULL; +#define eprosima_fastdds_statistics_detail_SampleIdentity_s_max_key_cdr_typesize 0ULL; +#define eprosima_fastdds_statistics_EntityData_max_key_cdr_typesize 18ULL; +#define eprosima_fastdds_statistics_Entity2LocatorTraffic_max_key_cdr_typesize 45ULL; +#define eprosima_fastdds_statistics_detail_EntityId_s_max_key_cdr_typesize 0ULL; +#define eprosima_fastdds_statistics_EntityCount_max_key_cdr_typesize 18ULL; +#define eprosima_fastdds_statistics_WriterReaderData_max_key_cdr_typesize 36ULL; +#define eprosima_fastdds_statistics_SampleIdentityCount_max_key_cdr_typesize 28ULL; +#define eprosima_fastdds_statistics_Locator2LocatorData_max_key_cdr_typesize 53ULL; +#define eprosima_fastdds_statistics_detail_GUID_s_max_key_cdr_typesize 0ULL; +#define eprosima_fastdds_statistics_detail_SequenceNumber_s_max_key_cdr_typesize 0ULL; + eprosima::fastdds::statistics::detail::EntityId_s::EntityId_s() { - // m_value com.eprosima.idl.parser.typecode.ArrayTypeCode@5ae63ade + // octet m_value memset(&m_value, 0, (4) * 1); } @@ -52,7 +85,7 @@ eprosima::fastdds::statistics::detail::EntityId_s::EntityId_s( } eprosima::fastdds::statistics::detail::EntityId_s::EntityId_s( - EntityId_s&& x) noexcept + EntityId_s&& x) noexcept { m_value = std::move(x.m_value); } @@ -91,13 +124,8 @@ bool eprosima::fastdds::statistics::detail::EntityId_s::operator !=( size_t eprosima::fastdds::statistics::detail::EntityId_s::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += ((4) * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return eprosima_fastdds_statistics_detail_EntityId_s_max_cdr_typesize; } size_t eprosima::fastdds::statistics::detail::EntityId_s::getCdrSerializedSize( @@ -168,14 +196,12 @@ std::array& eprosima::fastdds::statistics::detail::EntityId_s::value return m_value; } + size_t eprosima::fastdds::statistics::detail::EntityId_s::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - return current_align; + static_cast(current_alignment); + return eprosima_fastdds_statistics_detail_EntityId_s_max_key_cdr_typesize; } bool eprosima::fastdds::statistics::detail::EntityId_s::isKeyDefined() @@ -187,12 +213,11 @@ void eprosima::fastdds::statistics::detail::EntityId_s::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - } eprosima::fastdds::statistics::detail::GuidPrefix_s::GuidPrefix_s() { - // m_value com.eprosima.idl.parser.typecode.ArrayTypeCode@1f36e637 + // octet m_value memset(&m_value, 0, (12) * 1); } @@ -208,7 +233,7 @@ eprosima::fastdds::statistics::detail::GuidPrefix_s::GuidPrefix_s( } eprosima::fastdds::statistics::detail::GuidPrefix_s::GuidPrefix_s( - GuidPrefix_s&& x) noexcept + GuidPrefix_s&& x) noexcept { m_value = std::move(x.m_value); } @@ -247,13 +272,8 @@ bool eprosima::fastdds::statistics::detail::GuidPrefix_s::operator !=( size_t eprosima::fastdds::statistics::detail::GuidPrefix_s::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += ((12) * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return eprosima_fastdds_statistics_detail_GuidPrefix_s_max_cdr_typesize; } size_t eprosima::fastdds::statistics::detail::GuidPrefix_s::getCdrSerializedSize( @@ -324,14 +344,12 @@ std::array& eprosima::fastdds::statistics::detail::GuidPrefix_s::va return m_value; } + size_t eprosima::fastdds::statistics::detail::GuidPrefix_s::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - return current_align; + static_cast(current_alignment); + return eprosima_fastdds_statistics_detail_GuidPrefix_s_max_key_cdr_typesize; } bool eprosima::fastdds::statistics::detail::GuidPrefix_s::isKeyDefined() @@ -343,14 +361,13 @@ void eprosima::fastdds::statistics::detail::GuidPrefix_s::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - } eprosima::fastdds::statistics::detail::GUID_s::GUID_s() { - // m_guidPrefix com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@59906517 + // eprosima::fastdds::statistics::detail::GuidPrefix_s m_guidPrefix - // m_entityId com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@5bfbf16f + // eprosima::fastdds::statistics::detail::EntityId_s m_entityId } @@ -369,7 +386,7 @@ eprosima::fastdds::statistics::detail::GUID_s::GUID_s( } eprosima::fastdds::statistics::detail::GUID_s::GUID_s( - GUID_s&& x) noexcept + GUID_s&& x) noexcept { m_guidPrefix = std::move(x.m_guidPrefix); m_entityId = std::move(x.m_entityId); @@ -411,13 +428,8 @@ bool eprosima::fastdds::statistics::detail::GUID_s::operator !=( size_t eprosima::fastdds::statistics::detail::GUID_s::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += eprosima::fastdds::statistics::detail::GuidPrefix_s::getMaxCdrSerializedSize(current_alignment); - current_alignment += eprosima::fastdds::statistics::detail::EntityId_s::getMaxCdrSerializedSize(current_alignment); - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return eprosima_fastdds_statistics_detail_GUID_s_max_cdr_typesize; } size_t eprosima::fastdds::statistics::detail::GUID_s::getCdrSerializedSize( @@ -526,16 +538,12 @@ eprosima::fastdds::statistics::detail::EntityId_s& eprosima::fastdds::statistics return m_entityId; } + size_t eprosima::fastdds::statistics::detail::GUID_s::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - - - return current_align; + static_cast(current_alignment); + return eprosima_fastdds_statistics_detail_GUID_s_max_key_cdr_typesize; } bool eprosima::fastdds::statistics::detail::GUID_s::isKeyDefined() @@ -547,14 +555,13 @@ void eprosima::fastdds::statistics::detail::GUID_s::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - } eprosima::fastdds::statistics::detail::SequenceNumber_s::SequenceNumber_s() { - // m_high com.eprosima.idl.parser.typecode.PrimitiveTypeCode@4d3167f4 + // long m_high m_high = 0; - // m_low com.eprosima.idl.parser.typecode.PrimitiveTypeCode@ed9d034 + // unsigned long m_low m_low = 0; } @@ -573,7 +580,7 @@ eprosima::fastdds::statistics::detail::SequenceNumber_s::SequenceNumber_s( } eprosima::fastdds::statistics::detail::SequenceNumber_s::SequenceNumber_s( - SequenceNumber_s&& x) noexcept + SequenceNumber_s&& x) noexcept { m_high = x.m_high; m_low = x.m_low; @@ -615,17 +622,8 @@ bool eprosima::fastdds::statistics::detail::SequenceNumber_s::operator !=( size_t eprosima::fastdds::statistics::detail::SequenceNumber_s::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return eprosima_fastdds_statistics_detail_SequenceNumber_s_max_cdr_typesize; } size_t eprosima::fastdds::statistics::detail::SequenceNumber_s::getCdrSerializedSize( @@ -720,16 +718,12 @@ uint32_t& eprosima::fastdds::statistics::detail::SequenceNumber_s::low() } + size_t eprosima::fastdds::statistics::detail::SequenceNumber_s::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - - - return current_align; + static_cast(current_alignment); + return eprosima_fastdds_statistics_detail_SequenceNumber_s_max_key_cdr_typesize; } bool eprosima::fastdds::statistics::detail::SequenceNumber_s::isKeyDefined() @@ -741,14 +735,13 @@ void eprosima::fastdds::statistics::detail::SequenceNumber_s::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - } eprosima::fastdds::statistics::detail::SampleIdentity_s::SampleIdentity_s() { - // m_writer_guid com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@1060b431 + // eprosima::fastdds::statistics::detail::GUID_s m_writer_guid - // m_sequence_number com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@612679d6 + // eprosima::fastdds::statistics::detail::SequenceNumber_s m_sequence_number } @@ -767,7 +760,7 @@ eprosima::fastdds::statistics::detail::SampleIdentity_s::SampleIdentity_s( } eprosima::fastdds::statistics::detail::SampleIdentity_s::SampleIdentity_s( - SampleIdentity_s&& x) noexcept + SampleIdentity_s&& x) noexcept { m_writer_guid = std::move(x.m_writer_guid); m_sequence_number = std::move(x.m_sequence_number); @@ -809,13 +802,8 @@ bool eprosima::fastdds::statistics::detail::SampleIdentity_s::operator !=( size_t eprosima::fastdds::statistics::detail::SampleIdentity_s::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += eprosima::fastdds::statistics::detail::GUID_s::getMaxCdrSerializedSize(current_alignment); - current_alignment += eprosima::fastdds::statistics::detail::SequenceNumber_s::getMaxCdrSerializedSize(current_alignment); - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return eprosima_fastdds_statistics_detail_SampleIdentity_s_max_cdr_typesize; } size_t eprosima::fastdds::statistics::detail::SampleIdentity_s::getCdrSerializedSize( @@ -924,16 +912,12 @@ eprosima::fastdds::statistics::detail::SequenceNumber_s& eprosima::fastdds::stat return m_sequence_number; } + size_t eprosima::fastdds::statistics::detail::SampleIdentity_s::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - - - return current_align; + static_cast(current_alignment); + return eprosima_fastdds_statistics_detail_SampleIdentity_s_max_key_cdr_typesize; } bool eprosima::fastdds::statistics::detail::SampleIdentity_s::isKeyDefined() @@ -945,16 +929,15 @@ void eprosima::fastdds::statistics::detail::SampleIdentity_s::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - } eprosima::fastdds::statistics::detail::Locator_s::Locator_s() { - // m_kind com.eprosima.idl.parser.typecode.PrimitiveTypeCode@462d5aee + // long m_kind m_kind = 0; - // m_port com.eprosima.idl.parser.typecode.PrimitiveTypeCode@69b0fd6f + // unsigned long m_port m_port = 0; - // m_address com.eprosima.idl.parser.typecode.ArrayTypeCode@757942a1 + // octet m_address memset(&m_address, 0, (16) * 1); } @@ -975,7 +958,7 @@ eprosima::fastdds::statistics::detail::Locator_s::Locator_s( } eprosima::fastdds::statistics::detail::Locator_s::Locator_s( - Locator_s&& x) noexcept + Locator_s&& x) noexcept { m_kind = x.m_kind; m_port = x.m_port; @@ -1020,20 +1003,8 @@ bool eprosima::fastdds::statistics::detail::Locator_s::operator !=( size_t eprosima::fastdds::statistics::detail::Locator_s::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += ((16) * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return eprosima_fastdds_statistics_detail_Locator_s_max_cdr_typesize; } size_t eprosima::fastdds::statistics::detail::Locator_s::getCdrSerializedSize( @@ -1171,17 +1142,12 @@ std::array& eprosima::fastdds::statistics::detail::Locator_s::addre return m_address; } + size_t eprosima::fastdds::statistics::detail::Locator_s::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - - - - return current_align; + static_cast(current_alignment); + return eprosima_fastdds_statistics_detail_Locator_s_max_key_cdr_typesize; } bool eprosima::fastdds::statistics::detail::Locator_s::isKeyDefined() @@ -1193,23 +1159,22 @@ void eprosima::fastdds::statistics::detail::Locator_s::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - } eprosima::fastdds::statistics::DiscoveryTime::DiscoveryTime() { - // m_local_participant_guid com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@1060b431 + // eprosima::fastdds::statistics::detail::GUID_s m_local_participant_guid - // m_remote_entity_guid com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@1060b431 + // eprosima::fastdds::statistics::detail::GUID_s m_remote_entity_guid - // m_time com.eprosima.idl.parser.typecode.PrimitiveTypeCode@1e802ef9 + // unsigned long long m_time m_time = 0; - // m_host com.eprosima.idl.parser.typecode.StringTypeCode@2b6faea6 + // string m_host m_host =""; - // m_user com.eprosima.idl.parser.typecode.StringTypeCode@778d1062 + // string m_user m_user =""; - // m_process com.eprosima.idl.parser.typecode.StringTypeCode@670002 + // string m_process m_process =""; } @@ -1236,7 +1201,7 @@ eprosima::fastdds::statistics::DiscoveryTime::DiscoveryTime( } eprosima::fastdds::statistics::DiscoveryTime::DiscoveryTime( - DiscoveryTime&& x) noexcept + DiscoveryTime&& x) noexcept { m_local_participant_guid = std::move(x.m_local_participant_guid); m_remote_entity_guid = std::move(x.m_remote_entity_guid); @@ -1290,22 +1255,8 @@ bool eprosima::fastdds::statistics::DiscoveryTime::operator !=( size_t eprosima::fastdds::statistics::DiscoveryTime::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += eprosima::fastdds::statistics::detail::GUID_s::getMaxCdrSerializedSize(current_alignment); - current_alignment += eprosima::fastdds::statistics::detail::GUID_s::getMaxCdrSerializedSize(current_alignment); - current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + 255 + 1; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + 255 + 1; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + 255 + 1; - - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return eprosima_fastdds_statistics_DiscoveryTime_max_cdr_typesize; } size_t eprosima::fastdds::statistics::DiscoveryTime::getCdrSerializedSize( @@ -1570,20 +1521,12 @@ std::string& eprosima::fastdds::statistics::DiscoveryTime::process() return m_process; } + size_t eprosima::fastdds::statistics::DiscoveryTime::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - current_align += eprosima::fastdds::statistics::detail::GUID_s::getMaxCdrSerializedSize(current_align); - current_align += eprosima::fastdds::statistics::detail::GUID_s::getMaxCdrSerializedSize(current_align); - - - - - - return current_align; + static_cast(current_alignment); + return eprosima_fastdds_statistics_DiscoveryTime_max_key_cdr_typesize; } bool eprosima::fastdds::statistics::DiscoveryTime::isKeyDefined() @@ -1595,16 +1538,19 @@ void eprosima::fastdds::statistics::DiscoveryTime::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - scdr << m_local_participant_guid; - scdr << m_remote_entity_guid; - + m_local_participant_guid.serialize(scdr); + m_remote_entity_guid.serialize(scdr); + + + + } eprosima::fastdds::statistics::EntityCount::EntityCount() { - // m_guid com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@1060b431 + // eprosima::fastdds::statistics::detail::GUID_s m_guid - // m_count com.eprosima.idl.parser.typecode.PrimitiveTypeCode@1ed1993a + // unsigned long long m_count m_count = 0; } @@ -1623,7 +1569,7 @@ eprosima::fastdds::statistics::EntityCount::EntityCount( } eprosima::fastdds::statistics::EntityCount::EntityCount( - EntityCount&& x) noexcept + EntityCount&& x) noexcept { m_guid = std::move(x.m_guid); m_count = x.m_count; @@ -1665,15 +1611,8 @@ bool eprosima::fastdds::statistics::EntityCount::operator !=( size_t eprosima::fastdds::statistics::EntityCount::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += eprosima::fastdds::statistics::detail::GUID_s::getMaxCdrSerializedSize(current_alignment); - current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return eprosima_fastdds_statistics_EntityCount_max_cdr_typesize; } size_t eprosima::fastdds::statistics::EntityCount::getCdrSerializedSize( @@ -1775,16 +1714,12 @@ uint64_t& eprosima::fastdds::statistics::EntityCount::count() } + size_t eprosima::fastdds::statistics::EntityCount::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - current_align += eprosima::fastdds::statistics::detail::GUID_s::getMaxCdrSerializedSize(current_align); - - - return current_align; + static_cast(current_alignment); + return eprosima_fastdds_statistics_EntityCount_max_key_cdr_typesize; } bool eprosima::fastdds::statistics::EntityCount::isKeyDefined() @@ -1796,15 +1731,15 @@ void eprosima::fastdds::statistics::EntityCount::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - scdr << m_guid; - + m_guid.serialize(scdr); + } eprosima::fastdds::statistics::SampleIdentityCount::SampleIdentityCount() { - // m_sample_id com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@4b5a5ed1 + // eprosima::fastdds::statistics::detail::SampleIdentity_s m_sample_id - // m_count com.eprosima.idl.parser.typecode.PrimitiveTypeCode@59d016c9 + // unsigned long long m_count m_count = 0; } @@ -1823,7 +1758,7 @@ eprosima::fastdds::statistics::SampleIdentityCount::SampleIdentityCount( } eprosima::fastdds::statistics::SampleIdentityCount::SampleIdentityCount( - SampleIdentityCount&& x) noexcept + SampleIdentityCount&& x) noexcept { m_sample_id = std::move(x.m_sample_id); m_count = x.m_count; @@ -1865,15 +1800,8 @@ bool eprosima::fastdds::statistics::SampleIdentityCount::operator !=( size_t eprosima::fastdds::statistics::SampleIdentityCount::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += eprosima::fastdds::statistics::detail::SampleIdentity_s::getMaxCdrSerializedSize(current_alignment); - current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return eprosima_fastdds_statistics_SampleIdentityCount_max_cdr_typesize; } size_t eprosima::fastdds::statistics::SampleIdentityCount::getCdrSerializedSize( @@ -1975,16 +1903,12 @@ uint64_t& eprosima::fastdds::statistics::SampleIdentityCount::count() } + size_t eprosima::fastdds::statistics::SampleIdentityCount::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - current_align += eprosima::fastdds::statistics::detail::SampleIdentity_s::getMaxCdrSerializedSize(current_align); - - - return current_align; + static_cast(current_alignment); + return eprosima_fastdds_statistics_SampleIdentityCount_max_key_cdr_typesize; } bool eprosima::fastdds::statistics::SampleIdentityCount::isKeyDefined() @@ -1996,21 +1920,21 @@ void eprosima::fastdds::statistics::SampleIdentityCount::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - scdr << m_sample_id; - + m_sample_id.serialize(scdr); + } eprosima::fastdds::statistics::Entity2LocatorTraffic::Entity2LocatorTraffic() { - // m_src_guid com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@1060b431 + // eprosima::fastdds::statistics::detail::GUID_s m_src_guid - // m_dst_locator com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@5c909414 + // eprosima::fastdds::statistics::detail::Locator_s m_dst_locator - // m_packet_count com.eprosima.idl.parser.typecode.PrimitiveTypeCode@4b14c583 + // unsigned long long m_packet_count m_packet_count = 0; - // m_byte_count com.eprosima.idl.parser.typecode.PrimitiveTypeCode@65466a6a + // unsigned long long m_byte_count m_byte_count = 0; - // m_byte_magnitude_order com.eprosima.idl.parser.typecode.PrimitiveTypeCode@4ddced80 + // short m_byte_magnitude_order m_byte_magnitude_order = 0; } @@ -2035,7 +1959,7 @@ eprosima::fastdds::statistics::Entity2LocatorTraffic::Entity2LocatorTraffic( } eprosima::fastdds::statistics::Entity2LocatorTraffic::Entity2LocatorTraffic( - Entity2LocatorTraffic&& x) noexcept + Entity2LocatorTraffic&& x) noexcept { m_src_guid = std::move(x.m_src_guid); m_dst_locator = std::move(x.m_dst_locator); @@ -2086,22 +2010,8 @@ bool eprosima::fastdds::statistics::Entity2LocatorTraffic::operator !=( size_t eprosima::fastdds::statistics::Entity2LocatorTraffic::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += eprosima::fastdds::statistics::detail::GUID_s::getMaxCdrSerializedSize(current_alignment); - current_alignment += eprosima::fastdds::statistics::detail::Locator_s::getMaxCdrSerializedSize(current_alignment); - current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - - current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - - current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); - - - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return eprosima_fastdds_statistics_Entity2LocatorTraffic_max_cdr_typesize; } size_t eprosima::fastdds::statistics::Entity2LocatorTraffic::getCdrSerializedSize( @@ -2309,19 +2219,12 @@ int16_t& eprosima::fastdds::statistics::Entity2LocatorTraffic::byte_magnitude_or } + size_t eprosima::fastdds::statistics::Entity2LocatorTraffic::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - current_align += eprosima::fastdds::statistics::detail::GUID_s::getMaxCdrSerializedSize(current_align); - current_align += eprosima::fastdds::statistics::detail::Locator_s::getMaxCdrSerializedSize(current_align); - - - - - return current_align; + static_cast(current_alignment); + return eprosima_fastdds_statistics_Entity2LocatorTraffic_max_key_cdr_typesize; } bool eprosima::fastdds::statistics::Entity2LocatorTraffic::isKeyDefined() @@ -2333,18 +2236,20 @@ void eprosima::fastdds::statistics::Entity2LocatorTraffic::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - scdr << m_src_guid; - scdr << m_dst_locator; - + m_src_guid.serialize(scdr); + m_dst_locator.serialize(scdr); + + + } eprosima::fastdds::statistics::WriterReaderData::WriterReaderData() { - // m_writer_guid com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@1060b431 + // eprosima::fastdds::statistics::detail::GUID_s m_writer_guid - // m_reader_guid com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@1060b431 + // eprosima::fastdds::statistics::detail::GUID_s m_reader_guid - // m_data com.eprosima.idl.parser.typecode.PrimitiveTypeCode@2ea227af + // float m_data m_data = 0.0; } @@ -2365,7 +2270,7 @@ eprosima::fastdds::statistics::WriterReaderData::WriterReaderData( } eprosima::fastdds::statistics::WriterReaderData::WriterReaderData( - WriterReaderData&& x) noexcept + WriterReaderData&& x) noexcept { m_writer_guid = std::move(x.m_writer_guid); m_reader_guid = std::move(x.m_reader_guid); @@ -2410,16 +2315,8 @@ bool eprosima::fastdds::statistics::WriterReaderData::operator !=( size_t eprosima::fastdds::statistics::WriterReaderData::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += eprosima::fastdds::statistics::detail::GUID_s::getMaxCdrSerializedSize(current_alignment); - current_alignment += eprosima::fastdds::statistics::detail::GUID_s::getMaxCdrSerializedSize(current_alignment); - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return eprosima_fastdds_statistics_WriterReaderData_max_cdr_typesize; } size_t eprosima::fastdds::statistics::WriterReaderData::getCdrSerializedSize( @@ -2561,17 +2458,12 @@ float& eprosima::fastdds::statistics::WriterReaderData::data() } + size_t eprosima::fastdds::statistics::WriterReaderData::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - current_align += eprosima::fastdds::statistics::detail::GUID_s::getMaxCdrSerializedSize(current_align); - current_align += eprosima::fastdds::statistics::detail::GUID_s::getMaxCdrSerializedSize(current_align); - - - return current_align; + static_cast(current_alignment); + return eprosima_fastdds_statistics_WriterReaderData_max_key_cdr_typesize; } bool eprosima::fastdds::statistics::WriterReaderData::isKeyDefined() @@ -2583,18 +2475,18 @@ void eprosima::fastdds::statistics::WriterReaderData::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - scdr << m_writer_guid; - scdr << m_reader_guid; - + m_writer_guid.serialize(scdr); + m_reader_guid.serialize(scdr); + } eprosima::fastdds::statistics::Locator2LocatorData::Locator2LocatorData() { - // m_src_locator com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@5c909414 + // eprosima::fastdds::statistics::detail::Locator_s m_src_locator - // m_dst_locator com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@5c909414 + // eprosima::fastdds::statistics::detail::Locator_s m_dst_locator - // m_data com.eprosima.idl.parser.typecode.PrimitiveTypeCode@4386f16 + // float m_data m_data = 0.0; } @@ -2615,7 +2507,7 @@ eprosima::fastdds::statistics::Locator2LocatorData::Locator2LocatorData( } eprosima::fastdds::statistics::Locator2LocatorData::Locator2LocatorData( - Locator2LocatorData&& x) noexcept + Locator2LocatorData&& x) noexcept { m_src_locator = std::move(x.m_src_locator); m_dst_locator = std::move(x.m_dst_locator); @@ -2660,16 +2552,8 @@ bool eprosima::fastdds::statistics::Locator2LocatorData::operator !=( size_t eprosima::fastdds::statistics::Locator2LocatorData::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += eprosima::fastdds::statistics::detail::Locator_s::getMaxCdrSerializedSize(current_alignment); - current_alignment += eprosima::fastdds::statistics::detail::Locator_s::getMaxCdrSerializedSize(current_alignment); - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return eprosima_fastdds_statistics_Locator2LocatorData_max_cdr_typesize; } size_t eprosima::fastdds::statistics::Locator2LocatorData::getCdrSerializedSize( @@ -2811,17 +2695,12 @@ float& eprosima::fastdds::statistics::Locator2LocatorData::data() } + size_t eprosima::fastdds::statistics::Locator2LocatorData::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - current_align += eprosima::fastdds::statistics::detail::Locator_s::getMaxCdrSerializedSize(current_align); - current_align += eprosima::fastdds::statistics::detail::Locator_s::getMaxCdrSerializedSize(current_align); - - - return current_align; + static_cast(current_alignment); + return eprosima_fastdds_statistics_Locator2LocatorData_max_key_cdr_typesize; } bool eprosima::fastdds::statistics::Locator2LocatorData::isKeyDefined() @@ -2833,16 +2712,16 @@ void eprosima::fastdds::statistics::Locator2LocatorData::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - scdr << m_src_locator; - scdr << m_dst_locator; - + m_src_locator.serialize(scdr); + m_dst_locator.serialize(scdr); + } eprosima::fastdds::statistics::EntityData::EntityData() { - // m_guid com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@1060b431 + // eprosima::fastdds::statistics::detail::GUID_s m_guid - // m_data com.eprosima.idl.parser.typecode.PrimitiveTypeCode@363ee3a2 + // float m_data m_data = 0.0; } @@ -2861,7 +2740,7 @@ eprosima::fastdds::statistics::EntityData::EntityData( } eprosima::fastdds::statistics::EntityData::EntityData( - EntityData&& x) noexcept + EntityData&& x) noexcept { m_guid = std::move(x.m_guid); m_data = x.m_data; @@ -2903,15 +2782,8 @@ bool eprosima::fastdds::statistics::EntityData::operator !=( size_t eprosima::fastdds::statistics::EntityData::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += eprosima::fastdds::statistics::detail::GUID_s::getMaxCdrSerializedSize(current_alignment); - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return eprosima_fastdds_statistics_EntityData_max_cdr_typesize; } size_t eprosima::fastdds::statistics::EntityData::getCdrSerializedSize( @@ -3013,16 +2885,12 @@ float& eprosima::fastdds::statistics::EntityData::data() } + size_t eprosima::fastdds::statistics::EntityData::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - current_align += eprosima::fastdds::statistics::detail::GUID_s::getMaxCdrSerializedSize(current_align); - - - return current_align; + static_cast(current_alignment); + return eprosima_fastdds_statistics_EntityData_max_key_cdr_typesize; } bool eprosima::fastdds::statistics::EntityData::isKeyDefined() @@ -3034,19 +2902,19 @@ void eprosima::fastdds::statistics::EntityData::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - scdr << m_guid; - + m_guid.serialize(scdr); + } eprosima::fastdds::statistics::PhysicalData::PhysicalData() { - // m_participant_guid com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@1060b431 + // eprosima::fastdds::statistics::detail::GUID_s m_participant_guid - // m_host com.eprosima.idl.parser.typecode.StringTypeCode@3c22fc4c + // string m_host m_host =""; - // m_user com.eprosima.idl.parser.typecode.StringTypeCode@460d0a57 + // string m_user m_user =""; - // m_process com.eprosima.idl.parser.typecode.StringTypeCode@47d90b9e + // string m_process m_process =""; } @@ -3069,7 +2937,7 @@ eprosima::fastdds::statistics::PhysicalData::PhysicalData( } eprosima::fastdds::statistics::PhysicalData::PhysicalData( - PhysicalData&& x) noexcept + PhysicalData&& x) noexcept { m_participant_guid = std::move(x.m_participant_guid); m_host = std::move(x.m_host); @@ -3117,18 +2985,8 @@ bool eprosima::fastdds::statistics::PhysicalData::operator !=( size_t eprosima::fastdds::statistics::PhysicalData::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += eprosima::fastdds::statistics::detail::GUID_s::getMaxCdrSerializedSize(current_alignment); - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + 255 + 1; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + 255 + 1; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + 255 + 1; - - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return eprosima_fastdds_statistics_PhysicalData_max_cdr_typesize; } size_t eprosima::fastdds::statistics::PhysicalData::getCdrSerializedSize( @@ -3320,18 +3178,12 @@ std::string& eprosima::fastdds::statistics::PhysicalData::process() return m_process; } + size_t eprosima::fastdds::statistics::PhysicalData::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - current_align += eprosima::fastdds::statistics::detail::GUID_s::getMaxCdrSerializedSize(current_align); - - - - - return current_align; + static_cast(current_alignment); + return eprosima_fastdds_statistics_PhysicalData_max_key_cdr_typesize; } bool eprosima::fastdds::statistics::PhysicalData::isKeyDefined() @@ -3343,29 +3195,31 @@ void eprosima::fastdds::statistics::PhysicalData::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - scdr << m_participant_guid; - + m_participant_guid.serialize(scdr); + + + } eprosima::fastdds::statistics::Data::Data() { m__d = HISTORY2HISTORY_LATENCY; - // m_writer_reader_data com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@48e4374 + // eprosima::fastdds::statistics::WriterReaderData m_writer_reader_data - // m_locator2locator_data com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@3d680b5a + // eprosima::fastdds::statistics::Locator2LocatorData m_locator2locator_data - // m_entity_data com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@4b5d6a01 + // eprosima::fastdds::statistics::EntityData m_entity_data - // m_entity2locator_traffic com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@4a22f9e2 + // eprosima::fastdds::statistics::Entity2LocatorTraffic m_entity2locator_traffic - // m_entity_count com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@3c419631 + // eprosima::fastdds::statistics::EntityCount m_entity_count - // m_discovery_time com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@418e7838 + // eprosima::fastdds::statistics::DiscoveryTime m_discovery_time - // m_sample_identity_count com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@61230f6a + // eprosima::fastdds::statistics::SampleIdentityCount m_sample_identity_count - // m_physical_data com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@3c130745 + // eprosima::fastdds::statistics::PhysicalData m_physical_data } @@ -4180,84 +4034,6 @@ eprosima::fastdds::statistics::PhysicalData& eprosima::fastdds::statistics::Data return m_physical_data; } -size_t eprosima::fastdds::statistics::Data::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - size_t reset_alignment = 0; - size_t union_max_size_serialized = 0; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - reset_alignment = current_alignment; - - reset_alignment += eprosima::fastdds::statistics::WriterReaderData::getMaxCdrSerializedSize(reset_alignment); - - if(union_max_size_serialized < reset_alignment) - union_max_size_serialized = reset_alignment; - - - reset_alignment = current_alignment; - - reset_alignment += eprosima::fastdds::statistics::Locator2LocatorData::getMaxCdrSerializedSize(reset_alignment); - - if(union_max_size_serialized < reset_alignment) - union_max_size_serialized = reset_alignment; - - - reset_alignment = current_alignment; - - reset_alignment += eprosima::fastdds::statistics::EntityData::getMaxCdrSerializedSize(reset_alignment); - - if(union_max_size_serialized < reset_alignment) - union_max_size_serialized = reset_alignment; - - - reset_alignment = current_alignment; - - reset_alignment += eprosima::fastdds::statistics::Entity2LocatorTraffic::getMaxCdrSerializedSize(reset_alignment); - - if(union_max_size_serialized < reset_alignment) - union_max_size_serialized = reset_alignment; - - - reset_alignment = current_alignment; - - reset_alignment += eprosima::fastdds::statistics::EntityCount::getMaxCdrSerializedSize(reset_alignment); - - if(union_max_size_serialized < reset_alignment) - union_max_size_serialized = reset_alignment; - - - reset_alignment = current_alignment; - - reset_alignment += eprosima::fastdds::statistics::DiscoveryTime::getMaxCdrSerializedSize(reset_alignment); - - if(union_max_size_serialized < reset_alignment) - union_max_size_serialized = reset_alignment; - - - reset_alignment = current_alignment; - - reset_alignment += eprosima::fastdds::statistics::SampleIdentityCount::getMaxCdrSerializedSize(reset_alignment); - - if(union_max_size_serialized < reset_alignment) - union_max_size_serialized = reset_alignment; - - - reset_alignment = current_alignment; - - reset_alignment += eprosima::fastdds::statistics::PhysicalData::getMaxCdrSerializedSize(reset_alignment); - - if(union_max_size_serialized < reset_alignment) - union_max_size_serialized = reset_alignment; - - - - return union_max_size_serialized - initial_alignment; -} - // TODO(Ricardo) Review size_t eprosima::fastdds::statistics::Data::getCdrSerializedSize( const eprosima::fastdds::statistics::Data& data, diff --git a/src/cpp/statistics/types/types.h b/src/cpp/statistics/types/types.h index 55778dc8843..b07df2854cd 100644 --- a/src/cpp/statistics/types/types.h +++ b/src/cpp/statistics/types/types.h @@ -154,11 +154,11 @@ namespace eprosima { eProsima_user_DllExport std::array& value(); /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -213,6 +213,7 @@ namespace eprosima { private: std::array m_value; + }; /*! * @brief This class represents the structure GuidPrefix_s defined by the user in the IDL file. @@ -301,11 +302,11 @@ namespace eprosima { eProsima_user_DllExport std::array& value(); /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -360,6 +361,7 @@ namespace eprosima { private: std::array m_value; + }; /*! * @brief This class represents the structure GUID_s defined by the user in the IDL file. @@ -473,11 +475,11 @@ namespace eprosima { eProsima_user_DllExport eprosima::fastdds::statistics::detail::EntityId_s& entityId(); /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -533,6 +535,7 @@ namespace eprosima { eprosima::fastdds::statistics::detail::GuidPrefix_s m_guidPrefix; eprosima::fastdds::statistics::detail::EntityId_s m_entityId; + }; /*! * @brief This class represents the structure SequenceNumber_s defined by the user in the IDL file. @@ -634,11 +637,11 @@ namespace eprosima { /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -694,6 +697,7 @@ namespace eprosima { int32_t m_high; uint32_t m_low; + }; /*! * @brief This class represents the structure SampleIdentity_s defined by the user in the IDL file. @@ -807,11 +811,11 @@ namespace eprosima { eProsima_user_DllExport eprosima::fastdds::statistics::detail::SequenceNumber_s& sequence_number(); /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -867,6 +871,7 @@ namespace eprosima { eprosima::fastdds::statistics::detail::GUID_s m_writer_guid; eprosima::fastdds::statistics::detail::SequenceNumber_s m_sequence_number; + }; /*! * @brief This class represents the structure Locator_s defined by the user in the IDL file. @@ -993,11 +998,11 @@ namespace eprosima { eProsima_user_DllExport std::array& address(); /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -1054,6 +1059,7 @@ namespace eprosima { int32_t m_kind; uint32_t m_port; std::array m_address; + }; } // namespace detail /*! @@ -1262,11 +1268,11 @@ namespace eprosima { eProsima_user_DllExport std::string& process(); /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -1326,6 +1332,7 @@ namespace eprosima { std::string m_host; std::string m_user; std::string m_process; + }; /*! * @brief This class represents the structure EntityCount defined by the user in the IDL file. @@ -1433,11 +1440,11 @@ namespace eprosima { /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -1493,6 +1500,7 @@ namespace eprosima { eprosima::fastdds::statistics::detail::GUID_s m_guid; uint64_t m_count; + }; /*! * @brief This class represents the structure SampleIdentityCount defined by the user in the IDL file. @@ -1600,11 +1608,11 @@ namespace eprosima { /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -1660,6 +1668,7 @@ namespace eprosima { eprosima::fastdds::statistics::detail::SampleIdentity_s m_sample_id; uint64_t m_count; + }; /*! * @brief This class represents the structure Entity2LocatorTraffic defined by the user in the IDL file. @@ -1830,11 +1839,11 @@ namespace eprosima { /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -1893,6 +1902,7 @@ namespace eprosima { uint64_t m_packet_count; uint64_t m_byte_count; int16_t m_byte_magnitude_order; + }; /*! * @brief This class represents the structure WriterReaderData defined by the user in the IDL file. @@ -2025,11 +2035,11 @@ namespace eprosima { /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -2086,6 +2096,7 @@ namespace eprosima { eprosima::fastdds::statistics::detail::GUID_s m_writer_guid; eprosima::fastdds::statistics::detail::GUID_s m_reader_guid; float m_data; + }; /*! * @brief This class represents the structure Locator2LocatorData defined by the user in the IDL file. @@ -2218,11 +2229,11 @@ namespace eprosima { /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -2279,6 +2290,7 @@ namespace eprosima { eprosima::fastdds::statistics::detail::Locator_s m_src_locator; eprosima::fastdds::statistics::detail::Locator_s m_dst_locator; float m_data; + }; /*! * @brief This class represents the structure EntityData defined by the user in the IDL file. @@ -2386,11 +2398,11 @@ namespace eprosima { /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -2446,6 +2458,7 @@ namespace eprosima { eprosima::fastdds::statistics::detail::GUID_s m_guid; float m_data; + }; /*! * @brief This class represents the structure PhysicalData defined by the user in the IDL file. @@ -2609,11 +2622,11 @@ namespace eprosima { eProsima_user_DllExport std::string& process(); /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -2671,6 +2684,7 @@ namespace eprosima { std::string m_host; std::string m_user; std::string m_process; + }; /*! * @brief This class represents the bitmask EventKind defined by the user in the IDL file. @@ -2993,15 +3007,6 @@ namespace eprosima { */ eProsima_user_DllExport eprosima::fastdds::statistics::PhysicalData& physical_data(); - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - /*! * @brief This function returns the serialized size of a data depending on the buffer alignment. * @param data Data which is calculated its serialized size. diff --git a/test/blackbox/types/Data1mb.cxx b/test/blackbox/types/Data1mb.cxx index d58ef8c38f9..27b86490168 100644 --- a/test/blackbox/types/Data1mb.cxx +++ b/test/blackbox/types/Data1mb.cxx @@ -34,9 +34,12 @@ using namespace eprosima::fastcdr::exception; #include +#define Data1mb_max_cdr_typesize 1024004ULL; +#define Data1mb_max_key_cdr_typesize 0ULL; + Data1mb::Data1mb() { - // m_data com.eprosima.idl.parser.typecode.SequenceTypeCode@76707e36 + // sequence m_data } @@ -91,16 +94,8 @@ bool Data1mb::operator !=( size_t Data1mb::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - current_alignment += (1024000 * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return Data1mb_max_cdr_typesize; } size_t Data1mb::getCdrSerializedSize( @@ -174,14 +169,12 @@ std::vector& Data1mb::data() return m_data; } + size_t Data1mb::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - return current_align; + static_cast(current_alignment); + return Data1mb_max_key_cdr_typesize; } bool Data1mb::isKeyDefined() @@ -193,5 +186,4 @@ void Data1mb::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - } diff --git a/test/blackbox/types/Data1mb.h b/test/blackbox/types/Data1mb.h index 8a051d679a9..973e9abaebc 100644 --- a/test/blackbox/types/Data1mb.h +++ b/test/blackbox/types/Data1mb.h @@ -150,11 +150,11 @@ class Data1mb eProsima_user_DllExport std::vector& data(); /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -209,6 +209,7 @@ class Data1mb private: std::vector m_data; + }; #endif // _FAST_DDS_GENERATED_DATA1MB_H_ \ No newline at end of file diff --git a/test/blackbox/types/Data64kb.cxx b/test/blackbox/types/Data64kb.cxx index acde08c8e9e..86908f33a30 100644 --- a/test/blackbox/types/Data64kb.cxx +++ b/test/blackbox/types/Data64kb.cxx @@ -34,9 +34,12 @@ using namespace eprosima::fastcdr::exception; #include +#define Data64kb_max_cdr_typesize 64000ULL; +#define Data64kb_max_key_cdr_typesize 0ULL; + Data64kb::Data64kb() { - // m_data com.eprosima.idl.parser.typecode.SequenceTypeCode@76707e36 + // sequence m_data } @@ -91,16 +94,8 @@ bool Data64kb::operator !=( size_t Data64kb::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - current_alignment += (63996 * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return Data64kb_max_cdr_typesize; } size_t Data64kb::getCdrSerializedSize( @@ -174,14 +169,12 @@ std::vector& Data64kb::data() return m_data; } + size_t Data64kb::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - return current_align; + static_cast(current_alignment); + return Data64kb_max_key_cdr_typesize; } bool Data64kb::isKeyDefined() @@ -193,5 +186,4 @@ void Data64kb::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - } diff --git a/test/blackbox/types/Data64kb.h b/test/blackbox/types/Data64kb.h index 73ad173085a..307a4797566 100644 --- a/test/blackbox/types/Data64kb.h +++ b/test/blackbox/types/Data64kb.h @@ -150,11 +150,11 @@ class Data64kb eProsima_user_DllExport std::vector& data(); /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -209,6 +209,7 @@ class Data64kb private: std::vector m_data; + }; #endif // _FAST_DDS_GENERATED_DATA64KB_H_ \ No newline at end of file diff --git a/test/blackbox/types/FixedSized.cxx b/test/blackbox/types/FixedSized.cxx index 84502be88a5..262f06b844c 100644 --- a/test/blackbox/types/FixedSized.cxx +++ b/test/blackbox/types/FixedSized.cxx @@ -34,9 +34,12 @@ using namespace eprosima::fastcdr::exception; #include +#define FixedSized_max_cdr_typesize 2ULL; +#define FixedSized_max_key_cdr_typesize 0ULL; + FixedSized::FixedSized() { - // m_index com.eprosima.idl.parser.typecode.PrimitiveTypeCode@7fac631b + // unsigned short m_index m_index = 0; } @@ -91,13 +94,8 @@ bool FixedSized::operator !=( size_t FixedSized::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); - - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return FixedSized_max_cdr_typesize; } size_t FixedSized::getCdrSerializedSize( @@ -158,14 +156,12 @@ uint16_t& FixedSized::index() } + size_t FixedSized::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - return current_align; + static_cast(current_alignment); + return FixedSized_max_key_cdr_typesize; } bool FixedSized::isKeyDefined() @@ -177,5 +173,4 @@ void FixedSized::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - } diff --git a/test/blackbox/types/FixedSized.h b/test/blackbox/types/FixedSized.h index cf70ec267a8..1e4a7c48843 100644 --- a/test/blackbox/types/FixedSized.h +++ b/test/blackbox/types/FixedSized.h @@ -144,11 +144,11 @@ class FixedSized /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -203,6 +203,7 @@ class FixedSized private: uint16_t m_index; + }; #endif // _FAST_DDS_GENERATED_FIXEDSIZED_H_ \ No newline at end of file diff --git a/test/blackbox/types/HelloWorld.cxx b/test/blackbox/types/HelloWorld.cxx index 8601f5bcfc1..31c8939d8e8 100644 --- a/test/blackbox/types/HelloWorld.cxx +++ b/test/blackbox/types/HelloWorld.cxx @@ -34,11 +34,14 @@ using namespace eprosima::fastcdr::exception; #include +#define HelloWorld_max_cdr_typesize 137ULL; +#define HelloWorld_max_key_cdr_typesize 0ULL; + HelloWorld::HelloWorld() { - // m_index com.eprosima.idl.parser.typecode.PrimitiveTypeCode@5c5a1b69 + // unsigned short m_index m_index = 0; - // m_message com.eprosima.idl.parser.typecode.StringTypeCode@627551fb + // string m_message m_message =""; } @@ -99,16 +102,8 @@ bool HelloWorld::operator !=( size_t HelloWorld::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + 128 + 1; - - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return HelloWorld_max_cdr_typesize; } size_t HelloWorld::getCdrSerializedSize( @@ -215,16 +210,12 @@ eprosima::fastrtps::fixed_string<128>& HelloWorld::message() return m_message; } + size_t HelloWorld::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - - - return current_align; + static_cast(current_alignment); + return HelloWorld_max_key_cdr_typesize; } bool HelloWorld::isKeyDefined() @@ -236,5 +227,4 @@ void HelloWorld::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - } diff --git a/test/blackbox/types/HelloWorld.h b/test/blackbox/types/HelloWorld.h index 9a74ba88ac4..e8ab245f13a 100644 --- a/test/blackbox/types/HelloWorld.h +++ b/test/blackbox/types/HelloWorld.h @@ -169,11 +169,11 @@ class HelloWorld eProsima_user_DllExport eprosima::fastrtps::fixed_string<128>& message(); /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -229,6 +229,7 @@ class HelloWorld uint16_t m_index; eprosima::fastrtps::fixed_string<128> m_message; + }; #endif // _FAST_DDS_GENERATED_HELLOWORLD_H_ \ No newline at end of file diff --git a/test/blackbox/types/KeyedData1mb.cxx b/test/blackbox/types/KeyedData1mb.cxx index 9113ce9e14c..1823d4fb532 100644 --- a/test/blackbox/types/KeyedData1mb.cxx +++ b/test/blackbox/types/KeyedData1mb.cxx @@ -34,11 +34,14 @@ using namespace eprosima::fastcdr::exception; #include +#define KeyedData1mb_max_cdr_typesize 1024004ULL; +#define KeyedData1mb_max_key_cdr_typesize 2ULL; + KeyedData1mb::KeyedData1mb() { - // m_key com.eprosima.idl.parser.typecode.PrimitiveTypeCode@6a1aab78 + // unsigned short m_key m_key = 0; - // m_data com.eprosima.idl.parser.typecode.SequenceTypeCode@69b0fd6f + // sequence m_data } @@ -99,20 +102,8 @@ bool KeyedData1mb::operator !=( size_t KeyedData1mb::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - current_alignment += (1023996 * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return KeyedData1mb_max_cdr_typesize; } size_t KeyedData1mb::getCdrSerializedSize( @@ -222,18 +213,12 @@ std::vector& KeyedData1mb::data() return m_data; } + size_t KeyedData1mb::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - current_align += 2 + eprosima::fastcdr::Cdr::alignment(current_align, 2); - - - - - return current_align; + static_cast(current_alignment); + return KeyedData1mb_max_key_cdr_typesize; } bool KeyedData1mb::isKeyDefined() @@ -245,6 +230,7 @@ void KeyedData1mb::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - scdr << m_key; - + scdr << m_key; + + } diff --git a/test/blackbox/types/KeyedData1mb.h b/test/blackbox/types/KeyedData1mb.h index 3bef008310b..4dc0dd11260 100644 --- a/test/blackbox/types/KeyedData1mb.h +++ b/test/blackbox/types/KeyedData1mb.h @@ -169,11 +169,11 @@ class KeyedData1mb eProsima_user_DllExport std::vector& data(); /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -229,6 +229,7 @@ class KeyedData1mb uint16_t m_key; std::vector m_data; + }; #endif // _FAST_DDS_GENERATED_KEYEDDATA1MB_H_ \ No newline at end of file diff --git a/test/blackbox/types/KeyedHelloWorld.cxx b/test/blackbox/types/KeyedHelloWorld.cxx index 92195ec6762..b5bc2bbb956 100644 --- a/test/blackbox/types/KeyedHelloWorld.cxx +++ b/test/blackbox/types/KeyedHelloWorld.cxx @@ -34,13 +34,16 @@ using namespace eprosima::fastcdr::exception; #include +#define KeyedHelloWorld_max_cdr_typesize 137ULL; +#define KeyedHelloWorld_max_key_cdr_typesize 2ULL; + KeyedHelloWorld::KeyedHelloWorld() { - // m_key com.eprosima.idl.parser.typecode.PrimitiveTypeCode@7a9273a8 + // unsigned short m_key m_key = 0; - // m_index com.eprosima.idl.parser.typecode.PrimitiveTypeCode@26a7b76d + // unsigned short m_index m_index = 0; - // m_message com.eprosima.idl.parser.typecode.StringTypeCode@4abdb505 + // string m_message m_message =""; } @@ -106,19 +109,8 @@ bool KeyedHelloWorld::operator !=( size_t KeyedHelloWorld::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); - - - current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + 128 + 1; - - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return KeyedHelloWorld_max_cdr_typesize; } size_t KeyedHelloWorld::getCdrSerializedSize( @@ -258,19 +250,12 @@ eprosima::fastrtps::fixed_string<128>& KeyedHelloWorld::message() return m_message; } + size_t KeyedHelloWorld::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - current_align += 2 + eprosima::fastcdr::Cdr::alignment(current_align, 2); - - - - - - return current_align; + static_cast(current_alignment); + return KeyedHelloWorld_max_key_cdr_typesize; } bool KeyedHelloWorld::isKeyDefined() @@ -282,6 +267,8 @@ void KeyedHelloWorld::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - scdr << m_key; - + scdr << m_key; + + + } diff --git a/test/blackbox/types/KeyedHelloWorld.h b/test/blackbox/types/KeyedHelloWorld.h index 4c357003bf6..4ec3baa6e13 100644 --- a/test/blackbox/types/KeyedHelloWorld.h +++ b/test/blackbox/types/KeyedHelloWorld.h @@ -188,11 +188,11 @@ class KeyedHelloWorld eProsima_user_DllExport eprosima::fastrtps::fixed_string<128>& message(); /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -249,6 +249,7 @@ class KeyedHelloWorld uint16_t m_key; uint16_t m_index; eprosima::fastrtps::fixed_string<128> m_message; + }; #endif // _FAST_DDS_GENERATED_KEYEDHELLOWORLD_H_ \ No newline at end of file diff --git a/test/blackbox/types/StringTest.cxx b/test/blackbox/types/StringTest.cxx index 14fe917c98e..4d8e993dee0 100644 --- a/test/blackbox/types/StringTest.cxx +++ b/test/blackbox/types/StringTest.cxx @@ -34,9 +34,12 @@ using namespace eprosima::fastcdr::exception; #include +#define StringTest_max_cdr_typesize 10005ULL; +#define StringTest_max_key_cdr_typesize 0ULL; + StringTest::StringTest() { - // m_message com.eprosima.idl.parser.typecode.StringTypeCode@369f73a2 + // string m_message m_message =""; } @@ -91,12 +94,8 @@ bool StringTest::operator !=( size_t StringTest::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + 10000 + 1; - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return StringTest_max_cdr_typesize; } size_t StringTest::getCdrSerializedSize( @@ -168,14 +167,12 @@ eprosima::fastrtps::fixed_string<10000>& StringTest::message() return m_message; } + size_t StringTest::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - return current_align; + static_cast(current_alignment); + return StringTest_max_key_cdr_typesize; } bool StringTest::isKeyDefined() @@ -187,5 +184,4 @@ void StringTest::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - } diff --git a/test/blackbox/types/StringTest.h b/test/blackbox/types/StringTest.h index 4e96bffbad1..c789935559c 100644 --- a/test/blackbox/types/StringTest.h +++ b/test/blackbox/types/StringTest.h @@ -150,11 +150,11 @@ class StringTest eProsima_user_DllExport eprosima::fastrtps::fixed_string<10000>& message(); /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -209,6 +209,7 @@ class StringTest private: eprosima::fastrtps::fixed_string<10000> m_message; + }; #endif // _FAST_DDS_GENERATED_STRINGTEST_H_ \ No newline at end of file diff --git a/test/profiling/allocations/AllocTestType.cxx b/test/profiling/allocations/AllocTestType.cxx index 41b007e644a..d3aa73c5d76 100644 --- a/test/profiling/allocations/AllocTestType.cxx +++ b/test/profiling/allocations/AllocTestType.cxx @@ -34,9 +34,12 @@ using namespace eprosima::fastcdr::exception; #include +#define AllocTestType_max_cdr_typesize 4ULL; +#define AllocTestType_max_key_cdr_typesize 0ULL; + AllocTestType::AllocTestType() { - // m_index com.eprosima.idl.parser.typecode.PrimitiveTypeCode@610694f1 + // unsigned long m_index m_index = 0; } @@ -91,13 +94,8 @@ bool AllocTestType::operator !=( size_t AllocTestType::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return AllocTestType_max_cdr_typesize; } size_t AllocTestType::getCdrSerializedSize( @@ -158,14 +156,12 @@ uint32_t& AllocTestType::index() } + size_t AllocTestType::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - return current_align; + static_cast(current_alignment); + return AllocTestType_max_key_cdr_typesize; } bool AllocTestType::isKeyDefined() @@ -177,5 +173,4 @@ void AllocTestType::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - } diff --git a/test/profiling/allocations/AllocTestType.h b/test/profiling/allocations/AllocTestType.h index e77efd801c9..b09f07336e3 100644 --- a/test/profiling/allocations/AllocTestType.h +++ b/test/profiling/allocations/AllocTestType.h @@ -144,11 +144,11 @@ class AllocTestType /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -203,6 +203,7 @@ class AllocTestType private: uint32_t m_index; + }; #endif // _FAST_DDS_GENERATED_ALLOCTESTTYPE_H_ \ No newline at end of file diff --git a/test/unittest/dds/topic/DDSSQLFilter/data_types/ContentFilterTestType.cxx b/test/unittest/dds/topic/DDSSQLFilter/data_types/ContentFilterTestType.cxx index 6bce4da65a9..abeea0e69e4 100644 --- a/test/unittest/dds/topic/DDSSQLFilter/data_types/ContentFilterTestType.cxx +++ b/test/unittest/dds/topic/DDSSQLFilter/data_types/ContentFilterTestType.cxx @@ -34,39 +34,48 @@ using namespace eprosima::fastcdr::exception; #include +#define StructType_max_cdr_typesize 336ULL; +#define ContentFilterTestType_max_cdr_typesize 73112ULL; + + +#define StructType_max_key_cdr_typesize 0ULL; +#define ContentFilterTestType_max_key_cdr_typesize 0ULL; + + + StructType::StructType() { - // m_char_field com.eprosima.idl.parser.typecode.PrimitiveTypeCode@44c8afef + // char m_char_field m_char_field = 0; - // m_uint8_field com.eprosima.idl.parser.typecode.PrimitiveTypeCode@46daef40 + // octet m_uint8_field m_uint8_field = 0; - // m_int16_field com.eprosima.idl.parser.typecode.PrimitiveTypeCode@12f41634 + // short m_int16_field m_int16_field = 0; - // m_uint16_field com.eprosima.idl.parser.typecode.PrimitiveTypeCode@13c27452 + // unsigned short m_uint16_field m_uint16_field = 0; - // m_int32_field com.eprosima.idl.parser.typecode.PrimitiveTypeCode@371a67ec + // long m_int32_field m_int32_field = 0; - // m_uint32_field com.eprosima.idl.parser.typecode.PrimitiveTypeCode@5ed828d + // unsigned long m_uint32_field m_uint32_field = 0; - // m_int64_field com.eprosima.idl.parser.typecode.PrimitiveTypeCode@50d0686 + // long long m_int64_field m_int64_field = 0; - // m_uint64_field com.eprosima.idl.parser.typecode.PrimitiveTypeCode@7a3d45bd + // unsigned long long m_uint64_field m_uint64_field = 0; - // m_float_field com.eprosima.idl.parser.typecode.PrimitiveTypeCode@1e7c7811 + // float m_float_field m_float_field = 0.0; - // m_double_field com.eprosima.idl.parser.typecode.PrimitiveTypeCode@77ec78b9 + // double m_double_field m_double_field = 0.0; - // m_long_double_field com.eprosima.idl.parser.typecode.PrimitiveTypeCode@1a3869f4 + // long double m_long_double_field m_long_double_field = 0.0; - // m_bool_field com.eprosima.idl.parser.typecode.PrimitiveTypeCode@a38d7a3 + // boolean m_bool_field m_bool_field = false; - // m_string_field com.eprosima.idl.parser.typecode.StringTypeCode@77f99a05 + // string m_string_field m_string_field =""; - // m_enum_field com.eprosima.idl.parser.typecode.EnumTypeCode@63440df3 + // Color m_enum_field m_enum_field = ::RED; - // m_enum2_field com.eprosima.idl.parser.typecode.EnumTypeCode@3aeaafa6 + // Material m_enum2_field m_enum2_field = ::WOOD; } @@ -111,7 +120,7 @@ StructType::StructType( } StructType::StructType( - StructType&& x) noexcept + StructType&& x) noexcept { m_char_field = x.m_char_field; m_uint8_field = x.m_uint8_field; @@ -192,54 +201,8 @@ bool StructType::operator !=( size_t StructType::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); - - - current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - - current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - - current_alignment += 16 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); // 128 bits, but aligned as 64 - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + 255 + 1; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return StructType_max_cdr_typesize; } size_t StructType::getCdrSerializedSize( @@ -780,29 +743,12 @@ Material& StructType::enum2_field() } + size_t StructType::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - - - - - - - - - - - - - - - - return current_align; + static_cast(current_alignment); + return StructType_max_key_cdr_typesize; } bool StructType::isKeyDefined() @@ -814,140 +760,139 @@ void StructType::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - } ContentFilterTestType::ContentFilterTestType() { - // m_char_field com.eprosima.idl.parser.typecode.PrimitiveTypeCode@df27fae + // char m_char_field m_char_field = 0; - // m_uint8_field com.eprosima.idl.parser.typecode.PrimitiveTypeCode@16f7c8c1 + // octet m_uint8_field m_uint8_field = 0; - // m_int16_field com.eprosima.idl.parser.typecode.PrimitiveTypeCode@2f0a87b3 + // short m_int16_field m_int16_field = 0; - // m_uint16_field com.eprosima.idl.parser.typecode.PrimitiveTypeCode@319b92f3 + // unsigned short m_uint16_field m_uint16_field = 0; - // m_int32_field com.eprosima.idl.parser.typecode.PrimitiveTypeCode@27d415d9 + // long m_int32_field m_int32_field = 0; - // m_uint32_field com.eprosima.idl.parser.typecode.PrimitiveTypeCode@5c18298f + // unsigned long m_uint32_field m_uint32_field = 0; - // m_int64_field com.eprosima.idl.parser.typecode.PrimitiveTypeCode@31f924f5 + // long long m_int64_field m_int64_field = 0; - // m_uint64_field com.eprosima.idl.parser.typecode.PrimitiveTypeCode@5579bb86 + // unsigned long long m_uint64_field m_uint64_field = 0; - // m_float_field com.eprosima.idl.parser.typecode.PrimitiveTypeCode@5204062d + // float m_float_field m_float_field = 0.0; - // m_double_field com.eprosima.idl.parser.typecode.PrimitiveTypeCode@4fcd19b3 + // double m_double_field m_double_field = 0.0; - // m_long_double_field com.eprosima.idl.parser.typecode.PrimitiveTypeCode@376b4233 + // long double m_long_double_field m_long_double_field = 0.0; - // m_bool_field com.eprosima.idl.parser.typecode.PrimitiveTypeCode@2fd66ad3 + // boolean m_bool_field m_bool_field = false; - // m_string_field com.eprosima.idl.parser.typecode.StringTypeCode@5d11346a + // string m_string_field m_string_field =""; - // m_enum_field com.eprosima.idl.parser.typecode.EnumTypeCode@63440df3 + // Color m_enum_field m_enum_field = ::RED; - // m_enum2_field com.eprosima.idl.parser.typecode.EnumTypeCode@3aeaafa6 + // Material m_enum2_field m_enum2_field = ::WOOD; - // m_struct_field com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@7a36aefa + // StructType m_struct_field - // m_array_char_field com.eprosima.idl.parser.typecode.ArrayTypeCode@17211155 - memset(&m_array_char_field, 0, (max_array_size) * 1); - // m_array_uint8_field com.eprosima.idl.parser.typecode.ArrayTypeCode@b3d7190 - memset(&m_array_uint8_field, 0, (max_array_size) * 1); - // m_array_int16_field com.eprosima.idl.parser.typecode.ArrayTypeCode@5fdba6f9 - memset(&m_array_int16_field, 0, (max_array_size) * 2); - // m_array_uint16_field com.eprosima.idl.parser.typecode.ArrayTypeCode@10d59286 - memset(&m_array_uint16_field, 0, (max_array_size) * 2); - // m_array_int32_field com.eprosima.idl.parser.typecode.ArrayTypeCode@fe18270 - memset(&m_array_int32_field, 0, (max_array_size) * 4); - // m_array_uint32_field com.eprosima.idl.parser.typecode.ArrayTypeCode@6fb0d3ed - memset(&m_array_uint32_field, 0, (max_array_size) * 4); - // m_array_int64_field com.eprosima.idl.parser.typecode.ArrayTypeCode@6dde5c8c - memset(&m_array_int64_field, 0, (max_array_size) * 8); - // m_array_uint64_field com.eprosima.idl.parser.typecode.ArrayTypeCode@5123a213 - memset(&m_array_uint64_field, 0, (max_array_size) * 8); - // m_array_float_field com.eprosima.idl.parser.typecode.ArrayTypeCode@3b94d659 - memset(&m_array_float_field, 0, (max_array_size) * 4); - // m_array_double_field com.eprosima.idl.parser.typecode.ArrayTypeCode@24b1d79b - memset(&m_array_double_field, 0, (max_array_size) * 8); - // m_array_long_double_field com.eprosima.idl.parser.typecode.ArrayTypeCode@68ceda24 - memset(&m_array_long_double_field, 0, (max_array_size) * 16); - // m_array_bool_field com.eprosima.idl.parser.typecode.ArrayTypeCode@281e3708 - memset(&m_array_bool_field, 0, (max_array_size) * 1); - // m_array_string_field com.eprosima.idl.parser.typecode.ArrayTypeCode@35a50a4c + // char m_array_char_field + memset(&m_array_char_field, 0, (3) * 1); + // octet m_array_uint8_field + memset(&m_array_uint8_field, 0, (3) * 1); + // short m_array_int16_field + memset(&m_array_int16_field, 0, (3) * 2); + // unsigned short m_array_uint16_field + memset(&m_array_uint16_field, 0, (3) * 2); + // long m_array_int32_field + memset(&m_array_int32_field, 0, (3) * 4); + // unsigned long m_array_uint32_field + memset(&m_array_uint32_field, 0, (3) * 4); + // long long m_array_int64_field + memset(&m_array_int64_field, 0, (3) * 8); + // unsigned long long m_array_uint64_field + memset(&m_array_uint64_field, 0, (3) * 8); + // float m_array_float_field + memset(&m_array_float_field, 0, (3) * 4); + // double m_array_double_field + memset(&m_array_double_field, 0, (3) * 8); + // long double m_array_long_double_field + memset(&m_array_long_double_field, 0, (3) * 16); + // boolean m_array_bool_field + memset(&m_array_bool_field, 0, (3) * 1); + // string m_array_string_field - // m_array_enum_field com.eprosima.idl.parser.typecode.ArrayTypeCode@1f021e6c - memset(&m_array_enum_field, 0, (max_array_size) * 4); - // m_array_enum2_field com.eprosima.idl.parser.typecode.ArrayTypeCode@103f852 - memset(&m_array_enum2_field, 0, (max_array_size) * 4); - // m_array_struct_field com.eprosima.idl.parser.typecode.ArrayTypeCode@587c290d + // Color m_array_enum_field + memset(&m_array_enum_field, 0, (3) * 4); + // Material m_array_enum2_field + memset(&m_array_enum2_field, 0, (3) * 4); + // StructType m_array_struct_field - // m_bounded_sequence_char_field com.eprosima.idl.parser.typecode.SequenceTypeCode@4ae82894 + // sequence m_bounded_sequence_char_field - // m_bounded_sequence_uint8_field com.eprosima.idl.parser.typecode.SequenceTypeCode@543788f3 + // sequence m_bounded_sequence_uint8_field - // m_bounded_sequence_int16_field com.eprosima.idl.parser.typecode.SequenceTypeCode@6d3af739 + // sequence m_bounded_sequence_int16_field - // m_bounded_sequence_uint16_field com.eprosima.idl.parser.typecode.SequenceTypeCode@1da51a35 + // sequence m_bounded_sequence_uint16_field - // m_bounded_sequence_int32_field com.eprosima.idl.parser.typecode.SequenceTypeCode@16022d9d + // sequence m_bounded_sequence_int32_field - // m_bounded_sequence_uint32_field com.eprosima.idl.parser.typecode.SequenceTypeCode@7e9a5fbe + // sequence m_bounded_sequence_uint32_field - // m_bounded_sequence_int64_field com.eprosima.idl.parser.typecode.SequenceTypeCode@44a3ec6b + // sequence m_bounded_sequence_int64_field - // m_bounded_sequence_uint64_field com.eprosima.idl.parser.typecode.SequenceTypeCode@71623278 + // sequence m_bounded_sequence_uint64_field - // m_bounded_sequence_float_field com.eprosima.idl.parser.typecode.SequenceTypeCode@768b970c + // sequence m_bounded_sequence_float_field - // m_bounded_sequence_double_field com.eprosima.idl.parser.typecode.SequenceTypeCode@5a4041cc + // sequence m_bounded_sequence_double_field - // m_bounded_sequence_long_double_field com.eprosima.idl.parser.typecode.SequenceTypeCode@15b3e5b + // sequence m_bounded_sequence_long_double_field - // m_bounded_sequence_bool_field com.eprosima.idl.parser.typecode.SequenceTypeCode@61ca2dfa + // sequence m_bounded_sequence_bool_field - // m_bounded_sequence_string_field com.eprosima.idl.parser.typecode.SequenceTypeCode@4b53f538 + // sequence m_bounded_sequence_string_field - // m_bounded_sequence_enum_field com.eprosima.idl.parser.typecode.SequenceTypeCode@134593bf + // sequence m_bounded_sequence_enum_field - // m_bounded_sequence_enum2_field com.eprosima.idl.parser.typecode.SequenceTypeCode@4bb4de6a + // sequence m_bounded_sequence_enum2_field - // m_bounded_sequence_struct_field com.eprosima.idl.parser.typecode.SequenceTypeCode@7ba18f1b + // sequence m_bounded_sequence_struct_field - // m_unbounded_sequence_char_field com.eprosima.idl.parser.typecode.SequenceTypeCode@2f8f5f62 + // sequence m_unbounded_sequence_char_field - // m_unbounded_sequence_uint8_field com.eprosima.idl.parser.typecode.SequenceTypeCode@1068e947 + // sequence m_unbounded_sequence_uint8_field - // m_unbounded_sequence_int16_field com.eprosima.idl.parser.typecode.SequenceTypeCode@7dc222ae + // sequence m_unbounded_sequence_int16_field - // m_unbounded_sequence_uint16_field com.eprosima.idl.parser.typecode.SequenceTypeCode@aecb35a + // sequence m_unbounded_sequence_uint16_field - // m_unbounded_sequence_int32_field com.eprosima.idl.parser.typecode.SequenceTypeCode@5fcd892a + // sequence m_unbounded_sequence_int32_field - // m_unbounded_sequence_uint32_field com.eprosima.idl.parser.typecode.SequenceTypeCode@8b87145 + // sequence m_unbounded_sequence_uint32_field - // m_unbounded_sequence_int64_field com.eprosima.idl.parser.typecode.SequenceTypeCode@6483f5ae + // sequence m_unbounded_sequence_int64_field - // m_unbounded_sequence_uint64_field com.eprosima.idl.parser.typecode.SequenceTypeCode@b9afc07 + // sequence m_unbounded_sequence_uint64_field - // m_unbounded_sequence_float_field com.eprosima.idl.parser.typecode.SequenceTypeCode@382db087 + // sequence m_unbounded_sequence_float_field - // m_unbounded_sequence_double_field com.eprosima.idl.parser.typecode.SequenceTypeCode@73d4cc9e + // sequence m_unbounded_sequence_double_field - // m_unbounded_sequence_long_double_field com.eprosima.idl.parser.typecode.SequenceTypeCode@80169cf + // sequence m_unbounded_sequence_long_double_field - // m_unbounded_sequence_bool_field com.eprosima.idl.parser.typecode.SequenceTypeCode@5427c60c + // sequence m_unbounded_sequence_bool_field - // m_unbounded_sequence_string_field com.eprosima.idl.parser.typecode.SequenceTypeCode@15bfd87 + // sequence m_unbounded_sequence_string_field - // m_unbounded_sequence_enum_field com.eprosima.idl.parser.typecode.SequenceTypeCode@543e710e + // sequence m_unbounded_sequence_enum_field - // m_unbounded_sequence_enum2_field com.eprosima.idl.parser.typecode.SequenceTypeCode@57f23557 + // sequence m_unbounded_sequence_enum2_field - // m_unbounded_sequence_struct_field com.eprosima.idl.parser.typecode.SequenceTypeCode@3d0f8e03 + // sequence m_unbounded_sequence_struct_field } @@ -1090,7 +1035,7 @@ ContentFilterTestType::ContentFilterTestType( } ContentFilterTestType::ContentFilterTestType( - ContentFilterTestType&& x) noexcept + ContentFilterTestType&& x) noexcept { m_char_field = x.m_char_field; m_uint8_field = x.m_uint8_field; @@ -1318,6 +1263,15 @@ bool ContentFilterTestType::operator !=( size_t ContentFilterTestType::getMaxCdrSerializedSize( size_t current_alignment) { + static_cast(current_alignment); + return ContentFilterTestType_max_cdr_typesize; +} + +size_t ContentFilterTestType::getCdrSerializedSize( + const ContentFilterTestType& data, + size_t current_alignment) +{ + (void)data; size_t initial_alignment = current_alignment; @@ -1356,285 +1310,7 @@ size_t ContentFilterTestType::getMaxCdrSerializedSize( current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + 255 + 1; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += StructType::getMaxCdrSerializedSize(current_alignment); - current_alignment += ((max_array_size) * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += ((max_array_size) * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += ((max_array_size) * 2) + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); - - - current_alignment += ((max_array_size) * 2) + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); - - - current_alignment += ((max_array_size) * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += ((max_array_size) * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += ((max_array_size) * 8) + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - - current_alignment += ((max_array_size) * 8) + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - - current_alignment += ((max_array_size) * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += ((max_array_size) * 8) + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - - current_alignment += ((max_array_size) * 16) + eprosima::fastcdr::Cdr::alignment(current_alignment, 16); - - - current_alignment += ((max_array_size) * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - - for(size_t a = 0; a < (max_array_size); ++a) - { - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + 255 + 1; - } - current_alignment += ((max_array_size) * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += ((max_array_size) * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - - for(size_t a = 0; a < (max_array_size); ++a) - { - current_alignment += StructType::getMaxCdrSerializedSize(current_alignment);} - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - current_alignment += (max_seq_size * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - current_alignment += (max_seq_size * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - current_alignment += (max_seq_size * 2) + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); - - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - current_alignment += (max_seq_size * 2) + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); - - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - current_alignment += (max_seq_size * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - current_alignment += (max_seq_size * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - current_alignment += (max_seq_size * 8) + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - current_alignment += (max_seq_size * 8) + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - current_alignment += (max_seq_size * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - current_alignment += (max_seq_size * 8) + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - current_alignment += (max_seq_size * 16) + eprosima::fastcdr::Cdr::alignment(current_alignment, 16); - - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - current_alignment += (max_seq_size * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - for(size_t a = 0; a < max_seq_size; ++a) - { - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + 255 + 1; - } - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - current_alignment += (max_seq_size * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - current_alignment += (max_seq_size * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - for(size_t a = 0; a < max_seq_size; ++a) - { - current_alignment += StructType::getMaxCdrSerializedSize(current_alignment);} - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - current_alignment += (100 * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - current_alignment += (100 * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - current_alignment += (100 * 2) + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); - - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - current_alignment += (100 * 2) + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); - - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - current_alignment += (100 * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - current_alignment += (100 * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - current_alignment += (100 * 8) + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - current_alignment += (100 * 8) + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - current_alignment += (100 * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - current_alignment += (100 * 8) + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - current_alignment += (100 * 16) + eprosima::fastcdr::Cdr::alignment(current_alignment, 16); - - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - current_alignment += (100 * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - for(size_t a = 0; a < 100; ++a) - { - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + 255 + 1; - } - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - current_alignment += (100 * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - current_alignment += (100 * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - for(size_t a = 0; a < 100; ++a) - { - current_alignment += StructType::getMaxCdrSerializedSize(current_alignment);} - - - return current_alignment - initial_alignment; -} - -size_t ContentFilterTestType::getCdrSerializedSize( - const ContentFilterTestType& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); - - - current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); - + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.string_field().size() + 1; current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); @@ -1642,44 +1318,31 @@ size_t ContentFilterTestType::getCdrSerializedSize( current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - - current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - + current_alignment += StructType::getCdrSerializedSize(data.struct_field(), current_alignment); - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + current_alignment += ((3) * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + current_alignment += ((3) * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); + current_alignment += ((3) * 2) + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); + current_alignment += ((3) * 2) + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); - current_alignment += 16 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); // 128 bits, but aligned as 64 + current_alignment += ((3) * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + current_alignment += ((3) * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + current_alignment += ((3) * 8) + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.string_field().size() + 1; + current_alignment += ((3) * 8) + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + current_alignment += ((3) * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + current_alignment += ((3) * 8) + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + current_alignment += ((3) * 16) + eprosima::fastcdr::Cdr::alignment(current_alignment, 16); - - current_alignment += StructType::getCdrSerializedSize(data.struct_field(), current_alignment); - current_alignment += ((max_array_size) * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - current_alignment += ((max_array_size) * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - current_alignment += ((max_array_size) * 2) + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); - current_alignment += ((max_array_size) * 2) + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); - current_alignment += ((max_array_size) * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - current_alignment += ((max_array_size) * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - current_alignment += ((max_array_size) * 8) + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - current_alignment += ((max_array_size) * 8) + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - current_alignment += ((max_array_size) * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - current_alignment += ((max_array_size) * 8) + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - current_alignment += ((max_array_size) * 16) + eprosima::fastcdr::Cdr::alignment(current_alignment, 16); - current_alignment += ((max_array_size) * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + current_alignment += ((3) * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); for(size_t a = 0; a < data.array_string_field().size(); ++a) { @@ -1687,8 +1350,9 @@ size_t ContentFilterTestType::getCdrSerializedSize( } - current_alignment += ((max_array_size) * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - current_alignment += ((max_array_size) * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + current_alignment += ((3) * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + current_alignment += ((3) * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); for(size_t a = 0; a < data.array_struct_field().size(); ++a) { @@ -2677,7 +2341,7 @@ StructType& ContentFilterTestType::struct_field() * @param _array_char_field New value to be copied in member array_char_field */ void ContentFilterTestType::array_char_field( - const std::array& _array_char_field) + const std::array& _array_char_field) { m_array_char_field = _array_char_field; } @@ -2687,7 +2351,7 @@ void ContentFilterTestType::array_char_field( * @param _array_char_field New value to be moved in member array_char_field */ void ContentFilterTestType::array_char_field( - std::array&& _array_char_field) + std::array&& _array_char_field) { m_array_char_field = std::move(_array_char_field); } @@ -2696,7 +2360,7 @@ void ContentFilterTestType::array_char_field( * @brief This function returns a constant reference to member array_char_field * @return Constant reference to member array_char_field */ -const std::array& ContentFilterTestType::array_char_field() const +const std::array& ContentFilterTestType::array_char_field() const { return m_array_char_field; } @@ -2705,7 +2369,7 @@ const std::array& ContentFilterTestType::array_char_field( * @brief This function returns a reference to member array_char_field * @return Reference to member array_char_field */ -std::array& ContentFilterTestType::array_char_field() +std::array& ContentFilterTestType::array_char_field() { return m_array_char_field; } @@ -2714,7 +2378,7 @@ std::array& ContentFilterTestType::array_char_field() * @param _array_uint8_field New value to be copied in member array_uint8_field */ void ContentFilterTestType::array_uint8_field( - const std::array& _array_uint8_field) + const std::array& _array_uint8_field) { m_array_uint8_field = _array_uint8_field; } @@ -2724,7 +2388,7 @@ void ContentFilterTestType::array_uint8_field( * @param _array_uint8_field New value to be moved in member array_uint8_field */ void ContentFilterTestType::array_uint8_field( - std::array&& _array_uint8_field) + std::array&& _array_uint8_field) { m_array_uint8_field = std::move(_array_uint8_field); } @@ -2733,7 +2397,7 @@ void ContentFilterTestType::array_uint8_field( * @brief This function returns a constant reference to member array_uint8_field * @return Constant reference to member array_uint8_field */ -const std::array& ContentFilterTestType::array_uint8_field() const +const std::array& ContentFilterTestType::array_uint8_field() const { return m_array_uint8_field; } @@ -2742,7 +2406,7 @@ const std::array& ContentFilterTestType::array_uint8_fi * @brief This function returns a reference to member array_uint8_field * @return Reference to member array_uint8_field */ -std::array& ContentFilterTestType::array_uint8_field() +std::array& ContentFilterTestType::array_uint8_field() { return m_array_uint8_field; } @@ -2751,7 +2415,7 @@ std::array& ContentFilterTestType::array_uint8_field() * @param _array_int16_field New value to be copied in member array_int16_field */ void ContentFilterTestType::array_int16_field( - const std::array& _array_int16_field) + const std::array& _array_int16_field) { m_array_int16_field = _array_int16_field; } @@ -2761,7 +2425,7 @@ void ContentFilterTestType::array_int16_field( * @param _array_int16_field New value to be moved in member array_int16_field */ void ContentFilterTestType::array_int16_field( - std::array&& _array_int16_field) + std::array&& _array_int16_field) { m_array_int16_field = std::move(_array_int16_field); } @@ -2770,7 +2434,7 @@ void ContentFilterTestType::array_int16_field( * @brief This function returns a constant reference to member array_int16_field * @return Constant reference to member array_int16_field */ -const std::array& ContentFilterTestType::array_int16_field() const +const std::array& ContentFilterTestType::array_int16_field() const { return m_array_int16_field; } @@ -2779,7 +2443,7 @@ const std::array& ContentFilterTestType::array_int16_fi * @brief This function returns a reference to member array_int16_field * @return Reference to member array_int16_field */ -std::array& ContentFilterTestType::array_int16_field() +std::array& ContentFilterTestType::array_int16_field() { return m_array_int16_field; } @@ -2788,7 +2452,7 @@ std::array& ContentFilterTestType::array_int16_field() * @param _array_uint16_field New value to be copied in member array_uint16_field */ void ContentFilterTestType::array_uint16_field( - const std::array& _array_uint16_field) + const std::array& _array_uint16_field) { m_array_uint16_field = _array_uint16_field; } @@ -2798,7 +2462,7 @@ void ContentFilterTestType::array_uint16_field( * @param _array_uint16_field New value to be moved in member array_uint16_field */ void ContentFilterTestType::array_uint16_field( - std::array&& _array_uint16_field) + std::array&& _array_uint16_field) { m_array_uint16_field = std::move(_array_uint16_field); } @@ -2807,7 +2471,7 @@ void ContentFilterTestType::array_uint16_field( * @brief This function returns a constant reference to member array_uint16_field * @return Constant reference to member array_uint16_field */ -const std::array& ContentFilterTestType::array_uint16_field() const +const std::array& ContentFilterTestType::array_uint16_field() const { return m_array_uint16_field; } @@ -2816,7 +2480,7 @@ const std::array& ContentFilterTestType::array_uint16_ * @brief This function returns a reference to member array_uint16_field * @return Reference to member array_uint16_field */ -std::array& ContentFilterTestType::array_uint16_field() +std::array& ContentFilterTestType::array_uint16_field() { return m_array_uint16_field; } @@ -2825,7 +2489,7 @@ std::array& ContentFilterTestType::array_uint16_field( * @param _array_int32_field New value to be copied in member array_int32_field */ void ContentFilterTestType::array_int32_field( - const std::array& _array_int32_field) + const std::array& _array_int32_field) { m_array_int32_field = _array_int32_field; } @@ -2835,7 +2499,7 @@ void ContentFilterTestType::array_int32_field( * @param _array_int32_field New value to be moved in member array_int32_field */ void ContentFilterTestType::array_int32_field( - std::array&& _array_int32_field) + std::array&& _array_int32_field) { m_array_int32_field = std::move(_array_int32_field); } @@ -2844,7 +2508,7 @@ void ContentFilterTestType::array_int32_field( * @brief This function returns a constant reference to member array_int32_field * @return Constant reference to member array_int32_field */ -const std::array& ContentFilterTestType::array_int32_field() const +const std::array& ContentFilterTestType::array_int32_field() const { return m_array_int32_field; } @@ -2853,7 +2517,7 @@ const std::array& ContentFilterTestType::array_int32_fi * @brief This function returns a reference to member array_int32_field * @return Reference to member array_int32_field */ -std::array& ContentFilterTestType::array_int32_field() +std::array& ContentFilterTestType::array_int32_field() { return m_array_int32_field; } @@ -2862,7 +2526,7 @@ std::array& ContentFilterTestType::array_int32_field() * @param _array_uint32_field New value to be copied in member array_uint32_field */ void ContentFilterTestType::array_uint32_field( - const std::array& _array_uint32_field) + const std::array& _array_uint32_field) { m_array_uint32_field = _array_uint32_field; } @@ -2872,7 +2536,7 @@ void ContentFilterTestType::array_uint32_field( * @param _array_uint32_field New value to be moved in member array_uint32_field */ void ContentFilterTestType::array_uint32_field( - std::array&& _array_uint32_field) + std::array&& _array_uint32_field) { m_array_uint32_field = std::move(_array_uint32_field); } @@ -2881,7 +2545,7 @@ void ContentFilterTestType::array_uint32_field( * @brief This function returns a constant reference to member array_uint32_field * @return Constant reference to member array_uint32_field */ -const std::array& ContentFilterTestType::array_uint32_field() const +const std::array& ContentFilterTestType::array_uint32_field() const { return m_array_uint32_field; } @@ -2890,7 +2554,7 @@ const std::array& ContentFilterTestType::array_uint32_ * @brief This function returns a reference to member array_uint32_field * @return Reference to member array_uint32_field */ -std::array& ContentFilterTestType::array_uint32_field() +std::array& ContentFilterTestType::array_uint32_field() { return m_array_uint32_field; } @@ -2899,7 +2563,7 @@ std::array& ContentFilterTestType::array_uint32_field( * @param _array_int64_field New value to be copied in member array_int64_field */ void ContentFilterTestType::array_int64_field( - const std::array& _array_int64_field) + const std::array& _array_int64_field) { m_array_int64_field = _array_int64_field; } @@ -2909,7 +2573,7 @@ void ContentFilterTestType::array_int64_field( * @param _array_int64_field New value to be moved in member array_int64_field */ void ContentFilterTestType::array_int64_field( - std::array&& _array_int64_field) + std::array&& _array_int64_field) { m_array_int64_field = std::move(_array_int64_field); } @@ -2918,7 +2582,7 @@ void ContentFilterTestType::array_int64_field( * @brief This function returns a constant reference to member array_int64_field * @return Constant reference to member array_int64_field */ -const std::array& ContentFilterTestType::array_int64_field() const +const std::array& ContentFilterTestType::array_int64_field() const { return m_array_int64_field; } @@ -2927,7 +2591,7 @@ const std::array& ContentFilterTestType::array_int64_fi * @brief This function returns a reference to member array_int64_field * @return Reference to member array_int64_field */ -std::array& ContentFilterTestType::array_int64_field() +std::array& ContentFilterTestType::array_int64_field() { return m_array_int64_field; } @@ -2936,7 +2600,7 @@ std::array& ContentFilterTestType::array_int64_field() * @param _array_uint64_field New value to be copied in member array_uint64_field */ void ContentFilterTestType::array_uint64_field( - const std::array& _array_uint64_field) + const std::array& _array_uint64_field) { m_array_uint64_field = _array_uint64_field; } @@ -2946,7 +2610,7 @@ void ContentFilterTestType::array_uint64_field( * @param _array_uint64_field New value to be moved in member array_uint64_field */ void ContentFilterTestType::array_uint64_field( - std::array&& _array_uint64_field) + std::array&& _array_uint64_field) { m_array_uint64_field = std::move(_array_uint64_field); } @@ -2955,7 +2619,7 @@ void ContentFilterTestType::array_uint64_field( * @brief This function returns a constant reference to member array_uint64_field * @return Constant reference to member array_uint64_field */ -const std::array& ContentFilterTestType::array_uint64_field() const +const std::array& ContentFilterTestType::array_uint64_field() const { return m_array_uint64_field; } @@ -2964,7 +2628,7 @@ const std::array& ContentFilterTestType::array_uint64_ * @brief This function returns a reference to member array_uint64_field * @return Reference to member array_uint64_field */ -std::array& ContentFilterTestType::array_uint64_field() +std::array& ContentFilterTestType::array_uint64_field() { return m_array_uint64_field; } @@ -2973,7 +2637,7 @@ std::array& ContentFilterTestType::array_uint64_field( * @param _array_float_field New value to be copied in member array_float_field */ void ContentFilterTestType::array_float_field( - const std::array& _array_float_field) + const std::array& _array_float_field) { m_array_float_field = _array_float_field; } @@ -2983,7 +2647,7 @@ void ContentFilterTestType::array_float_field( * @param _array_float_field New value to be moved in member array_float_field */ void ContentFilterTestType::array_float_field( - std::array&& _array_float_field) + std::array&& _array_float_field) { m_array_float_field = std::move(_array_float_field); } @@ -2992,7 +2656,7 @@ void ContentFilterTestType::array_float_field( * @brief This function returns a constant reference to member array_float_field * @return Constant reference to member array_float_field */ -const std::array& ContentFilterTestType::array_float_field() const +const std::array& ContentFilterTestType::array_float_field() const { return m_array_float_field; } @@ -3001,7 +2665,7 @@ const std::array& ContentFilterTestType::array_float_fiel * @brief This function returns a reference to member array_float_field * @return Reference to member array_float_field */ -std::array& ContentFilterTestType::array_float_field() +std::array& ContentFilterTestType::array_float_field() { return m_array_float_field; } @@ -3010,7 +2674,7 @@ std::array& ContentFilterTestType::array_float_field() * @param _array_double_field New value to be copied in member array_double_field */ void ContentFilterTestType::array_double_field( - const std::array& _array_double_field) + const std::array& _array_double_field) { m_array_double_field = _array_double_field; } @@ -3020,7 +2684,7 @@ void ContentFilterTestType::array_double_field( * @param _array_double_field New value to be moved in member array_double_field */ void ContentFilterTestType::array_double_field( - std::array&& _array_double_field) + std::array&& _array_double_field) { m_array_double_field = std::move(_array_double_field); } @@ -3029,7 +2693,7 @@ void ContentFilterTestType::array_double_field( * @brief This function returns a constant reference to member array_double_field * @return Constant reference to member array_double_field */ -const std::array& ContentFilterTestType::array_double_field() const +const std::array& ContentFilterTestType::array_double_field() const { return m_array_double_field; } @@ -3038,7 +2702,7 @@ const std::array& ContentFilterTestType::array_double_fi * @brief This function returns a reference to member array_double_field * @return Reference to member array_double_field */ -std::array& ContentFilterTestType::array_double_field() +std::array& ContentFilterTestType::array_double_field() { return m_array_double_field; } @@ -3047,7 +2711,7 @@ std::array& ContentFilterTestType::array_double_field() * @param _array_long_double_field New value to be copied in member array_long_double_field */ void ContentFilterTestType::array_long_double_field( - const std::array& _array_long_double_field) + const std::array& _array_long_double_field) { m_array_long_double_field = _array_long_double_field; } @@ -3057,7 +2721,7 @@ void ContentFilterTestType::array_long_double_field( * @param _array_long_double_field New value to be moved in member array_long_double_field */ void ContentFilterTestType::array_long_double_field( - std::array&& _array_long_double_field) + std::array&& _array_long_double_field) { m_array_long_double_field = std::move(_array_long_double_field); } @@ -3066,7 +2730,7 @@ void ContentFilterTestType::array_long_double_field( * @brief This function returns a constant reference to member array_long_double_field * @return Constant reference to member array_long_double_field */ -const std::array& ContentFilterTestType::array_long_double_field() const +const std::array& ContentFilterTestType::array_long_double_field() const { return m_array_long_double_field; } @@ -3075,7 +2739,7 @@ const std::array& ContentFilterTestType::array_long * @brief This function returns a reference to member array_long_double_field * @return Reference to member array_long_double_field */ -std::array& ContentFilterTestType::array_long_double_field() +std::array& ContentFilterTestType::array_long_double_field() { return m_array_long_double_field; } @@ -3084,7 +2748,7 @@ std::array& ContentFilterTestType::array_long_doubl * @param _array_bool_field New value to be copied in member array_bool_field */ void ContentFilterTestType::array_bool_field( - const std::array& _array_bool_field) + const std::array& _array_bool_field) { m_array_bool_field = _array_bool_field; } @@ -3094,7 +2758,7 @@ void ContentFilterTestType::array_bool_field( * @param _array_bool_field New value to be moved in member array_bool_field */ void ContentFilterTestType::array_bool_field( - std::array&& _array_bool_field) + std::array&& _array_bool_field) { m_array_bool_field = std::move(_array_bool_field); } @@ -3103,7 +2767,7 @@ void ContentFilterTestType::array_bool_field( * @brief This function returns a constant reference to member array_bool_field * @return Constant reference to member array_bool_field */ -const std::array& ContentFilterTestType::array_bool_field() const +const std::array& ContentFilterTestType::array_bool_field() const { return m_array_bool_field; } @@ -3112,7 +2776,7 @@ const std::array& ContentFilterTestType::array_bool_field( * @brief This function returns a reference to member array_bool_field * @return Reference to member array_bool_field */ -std::array& ContentFilterTestType::array_bool_field() +std::array& ContentFilterTestType::array_bool_field() { return m_array_bool_field; } @@ -3121,7 +2785,7 @@ std::array& ContentFilterTestType::array_bool_field() * @param _array_string_field New value to be copied in member array_string_field */ void ContentFilterTestType::array_string_field( - const std::array& _array_string_field) + const std::array& _array_string_field) { m_array_string_field = _array_string_field; } @@ -3131,7 +2795,7 @@ void ContentFilterTestType::array_string_field( * @param _array_string_field New value to be moved in member array_string_field */ void ContentFilterTestType::array_string_field( - std::array&& _array_string_field) + std::array&& _array_string_field) { m_array_string_field = std::move(_array_string_field); } @@ -3140,7 +2804,7 @@ void ContentFilterTestType::array_string_field( * @brief This function returns a constant reference to member array_string_field * @return Constant reference to member array_string_field */ -const std::array& ContentFilterTestType::array_string_field() const +const std::array& ContentFilterTestType::array_string_field() const { return m_array_string_field; } @@ -3149,7 +2813,7 @@ const std::array& ContentFilterTestType::array_stri * @brief This function returns a reference to member array_string_field * @return Reference to member array_string_field */ -std::array& ContentFilterTestType::array_string_field() +std::array& ContentFilterTestType::array_string_field() { return m_array_string_field; } @@ -3158,7 +2822,7 @@ std::array& ContentFilterTestType::array_string_fie * @param _array_enum_field New value to be copied in member array_enum_field */ void ContentFilterTestType::array_enum_field( - const std::array& _array_enum_field) + const std::array& _array_enum_field) { m_array_enum_field = _array_enum_field; } @@ -3168,7 +2832,7 @@ void ContentFilterTestType::array_enum_field( * @param _array_enum_field New value to be moved in member array_enum_field */ void ContentFilterTestType::array_enum_field( - std::array&& _array_enum_field) + std::array&& _array_enum_field) { m_array_enum_field = std::move(_array_enum_field); } @@ -3177,7 +2841,7 @@ void ContentFilterTestType::array_enum_field( * @brief This function returns a constant reference to member array_enum_field * @return Constant reference to member array_enum_field */ -const std::array& ContentFilterTestType::array_enum_field() const +const std::array& ContentFilterTestType::array_enum_field() const { return m_array_enum_field; } @@ -3186,7 +2850,7 @@ const std::array& ContentFilterTestType::array_enum_field * @brief This function returns a reference to member array_enum_field * @return Reference to member array_enum_field */ -std::array& ContentFilterTestType::array_enum_field() +std::array& ContentFilterTestType::array_enum_field() { return m_array_enum_field; } @@ -3195,7 +2859,7 @@ std::array& ContentFilterTestType::array_enum_field() * @param _array_enum2_field New value to be copied in member array_enum2_field */ void ContentFilterTestType::array_enum2_field( - const std::array& _array_enum2_field) + const std::array& _array_enum2_field) { m_array_enum2_field = _array_enum2_field; } @@ -3205,7 +2869,7 @@ void ContentFilterTestType::array_enum2_field( * @param _array_enum2_field New value to be moved in member array_enum2_field */ void ContentFilterTestType::array_enum2_field( - std::array&& _array_enum2_field) + std::array&& _array_enum2_field) { m_array_enum2_field = std::move(_array_enum2_field); } @@ -3214,7 +2878,7 @@ void ContentFilterTestType::array_enum2_field( * @brief This function returns a constant reference to member array_enum2_field * @return Constant reference to member array_enum2_field */ -const std::array& ContentFilterTestType::array_enum2_field() const +const std::array& ContentFilterTestType::array_enum2_field() const { return m_array_enum2_field; } @@ -3223,7 +2887,7 @@ const std::array& ContentFilterTestType::array_enum2_f * @brief This function returns a reference to member array_enum2_field * @return Reference to member array_enum2_field */ -std::array& ContentFilterTestType::array_enum2_field() +std::array& ContentFilterTestType::array_enum2_field() { return m_array_enum2_field; } @@ -3232,7 +2896,7 @@ std::array& ContentFilterTestType::array_enum2_field() * @param _array_struct_field New value to be copied in member array_struct_field */ void ContentFilterTestType::array_struct_field( - const std::array& _array_struct_field) + const std::array& _array_struct_field) { m_array_struct_field = _array_struct_field; } @@ -3242,7 +2906,7 @@ void ContentFilterTestType::array_struct_field( * @param _array_struct_field New value to be moved in member array_struct_field */ void ContentFilterTestType::array_struct_field( - std::array&& _array_struct_field) + std::array&& _array_struct_field) { m_array_struct_field = std::move(_array_struct_field); } @@ -3251,7 +2915,7 @@ void ContentFilterTestType::array_struct_field( * @brief This function returns a constant reference to member array_struct_field * @return Constant reference to member array_struct_field */ -const std::array& ContentFilterTestType::array_struct_field() const +const std::array& ContentFilterTestType::array_struct_field() const { return m_array_struct_field; } @@ -3260,7 +2924,7 @@ const std::array& ContentFilterTestType::array_struc * @brief This function returns a reference to member array_struct_field * @return Reference to member array_struct_field */ -std::array& ContentFilterTestType::array_struct_field() +std::array& ContentFilterTestType::array_struct_field() { return m_array_struct_field; } @@ -4449,78 +4113,12 @@ std::vector& ContentFilterTestType::unbounded_sequence_struct_field( return m_unbounded_sequence_struct_field; } + size_t ContentFilterTestType::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - return current_align; + static_cast(current_alignment); + return ContentFilterTestType_max_key_cdr_typesize; } bool ContentFilterTestType::isKeyDefined() @@ -4532,5 +4130,4 @@ void ContentFilterTestType::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - } diff --git a/test/unittest/dds/topic/DDSSQLFilter/data_types/ContentFilterTestType.h b/test/unittest/dds/topic/DDSSQLFilter/data_types/ContentFilterTestType.h index 8b2fd6ef234..a4ad90df2fa 100644 --- a/test/unittest/dds/topic/DDSSQLFilter/data_types/ContentFilterTestType.h +++ b/test/unittest/dds/topic/DDSSQLFilter/data_types/ContentFilterTestType.h @@ -440,11 +440,11 @@ class StructType /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -513,6 +513,7 @@ class StructType std::string m_string_field; Color m_enum_field; Material m_enum2_field; + }; const uint32_t max_array_size = 3; const uint32_t max_seq_size = 5; @@ -897,401 +898,401 @@ class ContentFilterTestType * @param _array_char_field New value to be copied in member array_char_field */ eProsima_user_DllExport void array_char_field( - const std::array& _array_char_field); + const std::array& _array_char_field); /*! * @brief This function moves the value in member array_char_field * @param _array_char_field New value to be moved in member array_char_field */ eProsima_user_DllExport void array_char_field( - std::array&& _array_char_field); + std::array&& _array_char_field); /*! * @brief This function returns a constant reference to member array_char_field * @return Constant reference to member array_char_field */ - eProsima_user_DllExport const std::array& array_char_field() const; + eProsima_user_DllExport const std::array& array_char_field() const; /*! * @brief This function returns a reference to member array_char_field * @return Reference to member array_char_field */ - eProsima_user_DllExport std::array& array_char_field(); + eProsima_user_DllExport std::array& array_char_field(); /*! * @brief This function copies the value in member array_uint8_field * @param _array_uint8_field New value to be copied in member array_uint8_field */ eProsima_user_DllExport void array_uint8_field( - const std::array& _array_uint8_field); + const std::array& _array_uint8_field); /*! * @brief This function moves the value in member array_uint8_field * @param _array_uint8_field New value to be moved in member array_uint8_field */ eProsima_user_DllExport void array_uint8_field( - std::array&& _array_uint8_field); + std::array&& _array_uint8_field); /*! * @brief This function returns a constant reference to member array_uint8_field * @return Constant reference to member array_uint8_field */ - eProsima_user_DllExport const std::array& array_uint8_field() const; + eProsima_user_DllExport const std::array& array_uint8_field() const; /*! * @brief This function returns a reference to member array_uint8_field * @return Reference to member array_uint8_field */ - eProsima_user_DllExport std::array& array_uint8_field(); + eProsima_user_DllExport std::array& array_uint8_field(); /*! * @brief This function copies the value in member array_int16_field * @param _array_int16_field New value to be copied in member array_int16_field */ eProsima_user_DllExport void array_int16_field( - const std::array& _array_int16_field); + const std::array& _array_int16_field); /*! * @brief This function moves the value in member array_int16_field * @param _array_int16_field New value to be moved in member array_int16_field */ eProsima_user_DllExport void array_int16_field( - std::array&& _array_int16_field); + std::array&& _array_int16_field); /*! * @brief This function returns a constant reference to member array_int16_field * @return Constant reference to member array_int16_field */ - eProsima_user_DllExport const std::array& array_int16_field() const; + eProsima_user_DllExport const std::array& array_int16_field() const; /*! * @brief This function returns a reference to member array_int16_field * @return Reference to member array_int16_field */ - eProsima_user_DllExport std::array& array_int16_field(); + eProsima_user_DllExport std::array& array_int16_field(); /*! * @brief This function copies the value in member array_uint16_field * @param _array_uint16_field New value to be copied in member array_uint16_field */ eProsima_user_DllExport void array_uint16_field( - const std::array& _array_uint16_field); + const std::array& _array_uint16_field); /*! * @brief This function moves the value in member array_uint16_field * @param _array_uint16_field New value to be moved in member array_uint16_field */ eProsima_user_DllExport void array_uint16_field( - std::array&& _array_uint16_field); + std::array&& _array_uint16_field); /*! * @brief This function returns a constant reference to member array_uint16_field * @return Constant reference to member array_uint16_field */ - eProsima_user_DllExport const std::array& array_uint16_field() const; + eProsima_user_DllExport const std::array& array_uint16_field() const; /*! * @brief This function returns a reference to member array_uint16_field * @return Reference to member array_uint16_field */ - eProsima_user_DllExport std::array& array_uint16_field(); + eProsima_user_DllExport std::array& array_uint16_field(); /*! * @brief This function copies the value in member array_int32_field * @param _array_int32_field New value to be copied in member array_int32_field */ eProsima_user_DllExport void array_int32_field( - const std::array& _array_int32_field); + const std::array& _array_int32_field); /*! * @brief This function moves the value in member array_int32_field * @param _array_int32_field New value to be moved in member array_int32_field */ eProsima_user_DllExport void array_int32_field( - std::array&& _array_int32_field); + std::array&& _array_int32_field); /*! * @brief This function returns a constant reference to member array_int32_field * @return Constant reference to member array_int32_field */ - eProsima_user_DllExport const std::array& array_int32_field() const; + eProsima_user_DllExport const std::array& array_int32_field() const; /*! * @brief This function returns a reference to member array_int32_field * @return Reference to member array_int32_field */ - eProsima_user_DllExport std::array& array_int32_field(); + eProsima_user_DllExport std::array& array_int32_field(); /*! * @brief This function copies the value in member array_uint32_field * @param _array_uint32_field New value to be copied in member array_uint32_field */ eProsima_user_DllExport void array_uint32_field( - const std::array& _array_uint32_field); + const std::array& _array_uint32_field); /*! * @brief This function moves the value in member array_uint32_field * @param _array_uint32_field New value to be moved in member array_uint32_field */ eProsima_user_DllExport void array_uint32_field( - std::array&& _array_uint32_field); + std::array&& _array_uint32_field); /*! * @brief This function returns a constant reference to member array_uint32_field * @return Constant reference to member array_uint32_field */ - eProsima_user_DllExport const std::array& array_uint32_field() const; + eProsima_user_DllExport const std::array& array_uint32_field() const; /*! * @brief This function returns a reference to member array_uint32_field * @return Reference to member array_uint32_field */ - eProsima_user_DllExport std::array& array_uint32_field(); + eProsima_user_DllExport std::array& array_uint32_field(); /*! * @brief This function copies the value in member array_int64_field * @param _array_int64_field New value to be copied in member array_int64_field */ eProsima_user_DllExport void array_int64_field( - const std::array& _array_int64_field); + const std::array& _array_int64_field); /*! * @brief This function moves the value in member array_int64_field * @param _array_int64_field New value to be moved in member array_int64_field */ eProsima_user_DllExport void array_int64_field( - std::array&& _array_int64_field); + std::array&& _array_int64_field); /*! * @brief This function returns a constant reference to member array_int64_field * @return Constant reference to member array_int64_field */ - eProsima_user_DllExport const std::array& array_int64_field() const; + eProsima_user_DllExport const std::array& array_int64_field() const; /*! * @brief This function returns a reference to member array_int64_field * @return Reference to member array_int64_field */ - eProsima_user_DllExport std::array& array_int64_field(); + eProsima_user_DllExport std::array& array_int64_field(); /*! * @brief This function copies the value in member array_uint64_field * @param _array_uint64_field New value to be copied in member array_uint64_field */ eProsima_user_DllExport void array_uint64_field( - const std::array& _array_uint64_field); + const std::array& _array_uint64_field); /*! * @brief This function moves the value in member array_uint64_field * @param _array_uint64_field New value to be moved in member array_uint64_field */ eProsima_user_DllExport void array_uint64_field( - std::array&& _array_uint64_field); + std::array&& _array_uint64_field); /*! * @brief This function returns a constant reference to member array_uint64_field * @return Constant reference to member array_uint64_field */ - eProsima_user_DllExport const std::array& array_uint64_field() const; + eProsima_user_DllExport const std::array& array_uint64_field() const; /*! * @brief This function returns a reference to member array_uint64_field * @return Reference to member array_uint64_field */ - eProsima_user_DllExport std::array& array_uint64_field(); + eProsima_user_DllExport std::array& array_uint64_field(); /*! * @brief This function copies the value in member array_float_field * @param _array_float_field New value to be copied in member array_float_field */ eProsima_user_DllExport void array_float_field( - const std::array& _array_float_field); + const std::array& _array_float_field); /*! * @brief This function moves the value in member array_float_field * @param _array_float_field New value to be moved in member array_float_field */ eProsima_user_DllExport void array_float_field( - std::array&& _array_float_field); + std::array&& _array_float_field); /*! * @brief This function returns a constant reference to member array_float_field * @return Constant reference to member array_float_field */ - eProsima_user_DllExport const std::array& array_float_field() const; + eProsima_user_DllExport const std::array& array_float_field() const; /*! * @brief This function returns a reference to member array_float_field * @return Reference to member array_float_field */ - eProsima_user_DllExport std::array& array_float_field(); + eProsima_user_DllExport std::array& array_float_field(); /*! * @brief This function copies the value in member array_double_field * @param _array_double_field New value to be copied in member array_double_field */ eProsima_user_DllExport void array_double_field( - const std::array& _array_double_field); + const std::array& _array_double_field); /*! * @brief This function moves the value in member array_double_field * @param _array_double_field New value to be moved in member array_double_field */ eProsima_user_DllExport void array_double_field( - std::array&& _array_double_field); + std::array&& _array_double_field); /*! * @brief This function returns a constant reference to member array_double_field * @return Constant reference to member array_double_field */ - eProsima_user_DllExport const std::array& array_double_field() const; + eProsima_user_DllExport const std::array& array_double_field() const; /*! * @brief This function returns a reference to member array_double_field * @return Reference to member array_double_field */ - eProsima_user_DllExport std::array& array_double_field(); + eProsima_user_DllExport std::array& array_double_field(); /*! * @brief This function copies the value in member array_long_double_field * @param _array_long_double_field New value to be copied in member array_long_double_field */ eProsima_user_DllExport void array_long_double_field( - const std::array& _array_long_double_field); + const std::array& _array_long_double_field); /*! * @brief This function moves the value in member array_long_double_field * @param _array_long_double_field New value to be moved in member array_long_double_field */ eProsima_user_DllExport void array_long_double_field( - std::array&& _array_long_double_field); + std::array&& _array_long_double_field); /*! * @brief This function returns a constant reference to member array_long_double_field * @return Constant reference to member array_long_double_field */ - eProsima_user_DllExport const std::array& array_long_double_field() const; + eProsima_user_DllExport const std::array& array_long_double_field() const; /*! * @brief This function returns a reference to member array_long_double_field * @return Reference to member array_long_double_field */ - eProsima_user_DllExport std::array& array_long_double_field(); + eProsima_user_DllExport std::array& array_long_double_field(); /*! * @brief This function copies the value in member array_bool_field * @param _array_bool_field New value to be copied in member array_bool_field */ eProsima_user_DllExport void array_bool_field( - const std::array& _array_bool_field); + const std::array& _array_bool_field); /*! * @brief This function moves the value in member array_bool_field * @param _array_bool_field New value to be moved in member array_bool_field */ eProsima_user_DllExport void array_bool_field( - std::array&& _array_bool_field); + std::array&& _array_bool_field); /*! * @brief This function returns a constant reference to member array_bool_field * @return Constant reference to member array_bool_field */ - eProsima_user_DllExport const std::array& array_bool_field() const; + eProsima_user_DllExport const std::array& array_bool_field() const; /*! * @brief This function returns a reference to member array_bool_field * @return Reference to member array_bool_field */ - eProsima_user_DllExport std::array& array_bool_field(); + eProsima_user_DllExport std::array& array_bool_field(); /*! * @brief This function copies the value in member array_string_field * @param _array_string_field New value to be copied in member array_string_field */ eProsima_user_DllExport void array_string_field( - const std::array& _array_string_field); + const std::array& _array_string_field); /*! * @brief This function moves the value in member array_string_field * @param _array_string_field New value to be moved in member array_string_field */ eProsima_user_DllExport void array_string_field( - std::array&& _array_string_field); + std::array&& _array_string_field); /*! * @brief This function returns a constant reference to member array_string_field * @return Constant reference to member array_string_field */ - eProsima_user_DllExport const std::array& array_string_field() const; + eProsima_user_DllExport const std::array& array_string_field() const; /*! * @brief This function returns a reference to member array_string_field * @return Reference to member array_string_field */ - eProsima_user_DllExport std::array& array_string_field(); + eProsima_user_DllExport std::array& array_string_field(); /*! * @brief This function copies the value in member array_enum_field * @param _array_enum_field New value to be copied in member array_enum_field */ eProsima_user_DllExport void array_enum_field( - const std::array& _array_enum_field); + const std::array& _array_enum_field); /*! * @brief This function moves the value in member array_enum_field * @param _array_enum_field New value to be moved in member array_enum_field */ eProsima_user_DllExport void array_enum_field( - std::array&& _array_enum_field); + std::array&& _array_enum_field); /*! * @brief This function returns a constant reference to member array_enum_field * @return Constant reference to member array_enum_field */ - eProsima_user_DllExport const std::array& array_enum_field() const; + eProsima_user_DllExport const std::array& array_enum_field() const; /*! * @brief This function returns a reference to member array_enum_field * @return Reference to member array_enum_field */ - eProsima_user_DllExport std::array& array_enum_field(); + eProsima_user_DllExport std::array& array_enum_field(); /*! * @brief This function copies the value in member array_enum2_field * @param _array_enum2_field New value to be copied in member array_enum2_field */ eProsima_user_DllExport void array_enum2_field( - const std::array& _array_enum2_field); + const std::array& _array_enum2_field); /*! * @brief This function moves the value in member array_enum2_field * @param _array_enum2_field New value to be moved in member array_enum2_field */ eProsima_user_DllExport void array_enum2_field( - std::array&& _array_enum2_field); + std::array&& _array_enum2_field); /*! * @brief This function returns a constant reference to member array_enum2_field * @return Constant reference to member array_enum2_field */ - eProsima_user_DllExport const std::array& array_enum2_field() const; + eProsima_user_DllExport const std::array& array_enum2_field() const; /*! * @brief This function returns a reference to member array_enum2_field * @return Reference to member array_enum2_field */ - eProsima_user_DllExport std::array& array_enum2_field(); + eProsima_user_DllExport std::array& array_enum2_field(); /*! * @brief This function copies the value in member array_struct_field * @param _array_struct_field New value to be copied in member array_struct_field */ eProsima_user_DllExport void array_struct_field( - const std::array& _array_struct_field); + const std::array& _array_struct_field); /*! * @brief This function moves the value in member array_struct_field * @param _array_struct_field New value to be moved in member array_struct_field */ eProsima_user_DllExport void array_struct_field( - std::array&& _array_struct_field); + std::array&& _array_struct_field); /*! * @brief This function returns a constant reference to member array_struct_field * @return Constant reference to member array_struct_field */ - eProsima_user_DllExport const std::array& array_struct_field() const; + eProsima_user_DllExport const std::array& array_struct_field() const; /*! * @brief This function returns a reference to member array_struct_field * @return Reference to member array_struct_field */ - eProsima_user_DllExport std::array& array_struct_field(); + eProsima_user_DllExport std::array& array_struct_field(); /*! * @brief This function copies the value in member bounded_sequence_char_field * @param _bounded_sequence_char_field New value to be copied in member bounded_sequence_char_field @@ -2094,11 +2095,11 @@ class ContentFilterTestType eProsima_user_DllExport std::vector& unbounded_sequence_struct_field(); /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -2168,22 +2169,22 @@ class ContentFilterTestType Color m_enum_field; Material m_enum2_field; StructType m_struct_field; - std::array m_array_char_field; - std::array m_array_uint8_field; - std::array m_array_int16_field; - std::array m_array_uint16_field; - std::array m_array_int32_field; - std::array m_array_uint32_field; - std::array m_array_int64_field; - std::array m_array_uint64_field; - std::array m_array_float_field; - std::array m_array_double_field; - std::array m_array_long_double_field; - std::array m_array_bool_field; - std::array m_array_string_field; - std::array m_array_enum_field; - std::array m_array_enum2_field; - std::array m_array_struct_field; + std::array m_array_char_field; + std::array m_array_uint8_field; + std::array m_array_int16_field; + std::array m_array_uint16_field; + std::array m_array_int32_field; + std::array m_array_uint32_field; + std::array m_array_int64_field; + std::array m_array_uint64_field; + std::array m_array_float_field; + std::array m_array_double_field; + std::array m_array_long_double_field; + std::array m_array_bool_field; + std::array m_array_string_field; + std::array m_array_enum_field; + std::array m_array_enum2_field; + std::array m_array_struct_field; std::vector m_bounded_sequence_char_field; std::vector m_bounded_sequence_uint8_field; std::vector m_bounded_sequence_int16_field; @@ -2216,6 +2217,7 @@ class ContentFilterTestType std::vector m_unbounded_sequence_enum_field; std::vector m_unbounded_sequence_enum2_field; std::vector m_unbounded_sequence_struct_field; + }; #endif // _FAST_DDS_GENERATED_CONTENTFILTERTESTTYPE_H_ \ No newline at end of file diff --git a/test/unittest/dynamic_types/idl/Basic.cxx b/test/unittest/dynamic_types/idl/Basic.cxx index c8c5610dd56..0526f9a74a1 100644 --- a/test/unittest/dynamic_types/idl/Basic.cxx +++ b/test/unittest/dynamic_types/idl/Basic.cxx @@ -35,12 +35,93 @@ using namespace eprosima::fastcdr::exception; #include +#define ArraytStruct_max_cdr_typesize 28ULL; +#define SimpleUnionStruct_max_cdr_typesize 16ULL; + +#define WCharUnionStruct_max_cdr_typesize 16ULL; +#define OctetStruct_max_cdr_typesize 1ULL; +#define LongStruct_max_cdr_typesize 4ULL; +#define EnumStruct_max_cdr_typesize 4ULL; +#define BitsetStruct_max_cdr_typesize 8ULL; + + +#define DoubleStruct_max_cdr_typesize 8ULL; +#define LargeWStringStruct_max_cdr_typesize 167704ULL; +#define WCharStruct_max_cdr_typesize 4ULL; + +#define WStringStruct_max_cdr_typesize 1024ULL; +#define SequenceStruct_max_cdr_typesize 12ULL; + +#define ULongStruct_max_cdr_typesize 4ULL; +#define SequenceSequenceStruct_max_cdr_typesize 40ULL; +#define FloatStruct_max_cdr_typesize 4ULL; +#define LongDoubleStruct_max_cdr_typesize 16ULL; +#define StructStructStruct_max_cdr_typesize 24ULL; +#define UnionUnionUnionStruct_max_cdr_typesize 16ULL; +#define BoolStruct_max_cdr_typesize 1ULL; +#define MapMapStruct_max_cdr_typesize 52ULL; +#define AliasAliasStruct_max_cdr_typesize 4ULL; +#define ArrayArrayStruct_max_cdr_typesize 100ULL; +#define ShortStruct_max_cdr_typesize 2ULL; +#define MapStruct_max_cdr_typesize 20ULL; +#define UShortStruct_max_cdr_typesize 2ULL; + + +#define ULongLongStruct_max_cdr_typesize 8ULL; +#define AliasStruct_max_cdr_typesize 4ULL; +#define LargeStringStruct_max_cdr_typesize 41930ULL; +#define CharStruct_max_cdr_typesize 1ULL; +#define LongLongStruct_max_cdr_typesize 8ULL; +#define StringStruct_max_cdr_typesize 260ULL; +#define StructStruct_max_cdr_typesize 16ULL; + +#define ArraytStruct_max_key_cdr_typesize 0ULL; +#define SimpleUnionStruct_max_key_cdr_typesize 0ULL; + +#define WCharUnionStruct_max_key_cdr_typesize 0ULL; +#define OctetStruct_max_key_cdr_typesize 0ULL; +#define LongStruct_max_key_cdr_typesize 0ULL; +#define EnumStruct_max_key_cdr_typesize 0ULL; +#define BitsetStruct_max_key_cdr_typesize 0ULL; + + +#define DoubleStruct_max_key_cdr_typesize 0ULL; +#define LargeWStringStruct_max_key_cdr_typesize 0ULL; +#define WCharStruct_max_key_cdr_typesize 0ULL; + +#define WStringStruct_max_key_cdr_typesize 0ULL; +#define SequenceStruct_max_key_cdr_typesize 0ULL; + +#define ULongStruct_max_key_cdr_typesize 0ULL; +#define SequenceSequenceStruct_max_key_cdr_typesize 0ULL; +#define FloatStruct_max_key_cdr_typesize 0ULL; +#define LongDoubleStruct_max_key_cdr_typesize 0ULL; +#define StructStructStruct_max_key_cdr_typesize 0ULL; +#define UnionUnionUnionStruct_max_key_cdr_typesize 0ULL; +#define BoolStruct_max_key_cdr_typesize 0ULL; +#define MapMapStruct_max_key_cdr_typesize 0ULL; +#define AliasAliasStruct_max_key_cdr_typesize 0ULL; +#define ArrayArrayStruct_max_key_cdr_typesize 0ULL; +#define ShortStruct_max_key_cdr_typesize 0ULL; +#define MapStruct_max_key_cdr_typesize 0ULL; +#define UShortStruct_max_key_cdr_typesize 0ULL; + + +#define ULongLongStruct_max_key_cdr_typesize 0ULL; +#define AliasStruct_max_key_cdr_typesize 0ULL; +#define LargeStringStruct_max_key_cdr_typesize 0ULL; +#define CharStruct_max_key_cdr_typesize 0ULL; +#define LongLongStruct_max_key_cdr_typesize 0ULL; +#define StringStruct_max_key_cdr_typesize 0ULL; +#define StructStruct_max_key_cdr_typesize 0ULL; + + EnumStruct::EnumStruct() { - // m_my_enum com.eprosima.idl.parser.typecode.EnumTypeCode@fad74ee + // MyEnum m_my_enum m_my_enum = ::A; // Just to register all known types @@ -58,7 +139,7 @@ EnumStruct::EnumStruct( } EnumStruct::EnumStruct( - EnumStruct&& x) noexcept + EnumStruct&& x) noexcept { m_my_enum = x.m_my_enum; } @@ -97,13 +178,8 @@ bool EnumStruct::operator !=( size_t EnumStruct::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return EnumStruct_max_cdr_typesize; } size_t EnumStruct::getCdrSerializedSize( @@ -169,14 +245,12 @@ MyEnum& EnumStruct::my_enum() } + size_t EnumStruct::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - return current_align; + static_cast(current_alignment); + return EnumStruct_max_key_cdr_typesize; } bool EnumStruct::isKeyDefined() @@ -188,12 +262,11 @@ void EnumStruct::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - } AliasStruct::AliasStruct() { - // m_my_alias com.eprosima.idl.parser.typecode.AliasTypeCode@32d2fa64 + // MyAliasEnum m_my_alias m_my_alias = ::A; // Just to register all known types @@ -211,7 +284,7 @@ AliasStruct::AliasStruct( } AliasStruct::AliasStruct( - AliasStruct&& x) noexcept + AliasStruct&& x) noexcept { m_my_alias = x.m_my_alias; } @@ -250,13 +323,8 @@ bool AliasStruct::operator !=( size_t AliasStruct::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return AliasStruct_max_cdr_typesize; } size_t AliasStruct::getCdrSerializedSize( @@ -322,14 +390,12 @@ MyAliasEnum& AliasStruct::my_alias() } + size_t AliasStruct::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - return current_align; + static_cast(current_alignment); + return AliasStruct_max_key_cdr_typesize; } bool AliasStruct::isKeyDefined() @@ -341,12 +407,11 @@ void AliasStruct::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - } AliasAliasStruct::AliasAliasStruct() { - // m_my_alias_alias com.eprosima.idl.parser.typecode.AliasTypeCode@3e57cd70 + // MyAliasAliasEnum m_my_alias_alias m_my_alias_alias = ::A; // Just to register all known types @@ -364,7 +429,7 @@ AliasAliasStruct::AliasAliasStruct( } AliasAliasStruct::AliasAliasStruct( - AliasAliasStruct&& x) noexcept + AliasAliasStruct&& x) noexcept { m_my_alias_alias = x.m_my_alias_alias; } @@ -403,13 +468,8 @@ bool AliasAliasStruct::operator !=( size_t AliasAliasStruct::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return AliasAliasStruct_max_cdr_typesize; } size_t AliasAliasStruct::getCdrSerializedSize( @@ -475,14 +535,12 @@ MyAliasAliasEnum& AliasAliasStruct::my_alias_alias() } + size_t AliasAliasStruct::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - return current_align; + static_cast(current_alignment); + return AliasAliasStruct_max_key_cdr_typesize; } bool AliasAliasStruct::isKeyDefined() @@ -494,12 +552,11 @@ void AliasAliasStruct::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - } BoolStruct::BoolStruct() { - // m_my_bool com.eprosima.idl.parser.typecode.PrimitiveTypeCode@cb51256 + // boolean m_my_bool m_my_bool = false; // Just to register all known types @@ -517,7 +574,7 @@ BoolStruct::BoolStruct( } BoolStruct::BoolStruct( - BoolStruct&& x) noexcept + BoolStruct&& x) noexcept { m_my_bool = x.m_my_bool; } @@ -556,13 +613,8 @@ bool BoolStruct::operator !=( size_t BoolStruct::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return BoolStruct_max_cdr_typesize; } size_t BoolStruct::getCdrSerializedSize( @@ -623,14 +675,12 @@ bool& BoolStruct::my_bool() } + size_t BoolStruct::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - return current_align; + static_cast(current_alignment); + return BoolStruct_max_key_cdr_typesize; } bool BoolStruct::isKeyDefined() @@ -642,12 +692,11 @@ void BoolStruct::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - } OctetStruct::OctetStruct() { - // m_my_octet com.eprosima.idl.parser.typecode.PrimitiveTypeCode@5bcea91b + // octet m_my_octet m_my_octet = 0; // Just to register all known types @@ -665,7 +714,7 @@ OctetStruct::OctetStruct( } OctetStruct::OctetStruct( - OctetStruct&& x) noexcept + OctetStruct&& x) noexcept { m_my_octet = x.m_my_octet; } @@ -704,13 +753,8 @@ bool OctetStruct::operator !=( size_t OctetStruct::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return OctetStruct_max_cdr_typesize; } size_t OctetStruct::getCdrSerializedSize( @@ -771,14 +815,12 @@ uint8_t& OctetStruct::my_octet() } + size_t OctetStruct::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - return current_align; + static_cast(current_alignment); + return OctetStruct_max_key_cdr_typesize; } bool OctetStruct::isKeyDefined() @@ -790,12 +832,11 @@ void OctetStruct::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - } ShortStruct::ShortStruct() { - // m_my_int16 com.eprosima.idl.parser.typecode.PrimitiveTypeCode@13c27452 + // short m_my_int16 m_my_int16 = 0; // Just to register all known types @@ -813,7 +854,7 @@ ShortStruct::ShortStruct( } ShortStruct::ShortStruct( - ShortStruct&& x) noexcept + ShortStruct&& x) noexcept { m_my_int16 = x.m_my_int16; } @@ -852,13 +893,8 @@ bool ShortStruct::operator !=( size_t ShortStruct::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); - - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return ShortStruct_max_cdr_typesize; } size_t ShortStruct::getCdrSerializedSize( @@ -919,14 +955,12 @@ int16_t& ShortStruct::my_int16() } + size_t ShortStruct::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - return current_align; + static_cast(current_alignment); + return ShortStruct_max_key_cdr_typesize; } bool ShortStruct::isKeyDefined() @@ -938,12 +972,11 @@ void ShortStruct::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - } LongStruct::LongStruct() { - // m_my_int32 com.eprosima.idl.parser.typecode.PrimitiveTypeCode@ed9d034 + // long m_my_int32 m_my_int32 = 0; // Just to register all known types @@ -961,7 +994,7 @@ LongStruct::LongStruct( } LongStruct::LongStruct( - LongStruct&& x) noexcept + LongStruct&& x) noexcept { m_my_int32 = x.m_my_int32; } @@ -1000,13 +1033,8 @@ bool LongStruct::operator !=( size_t LongStruct::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return LongStruct_max_cdr_typesize; } size_t LongStruct::getCdrSerializedSize( @@ -1067,14 +1095,12 @@ int32_t& LongStruct::my_int32() } + size_t LongStruct::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - return current_align; + static_cast(current_alignment); + return LongStruct_max_key_cdr_typesize; } bool LongStruct::isKeyDefined() @@ -1086,12 +1112,11 @@ void LongStruct::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - } LongLongStruct::LongLongStruct() { - // m_my_int64 com.eprosima.idl.parser.typecode.PrimitiveTypeCode@e720b71 + // long long m_my_int64 m_my_int64 = 0; // Just to register all known types @@ -1109,7 +1134,7 @@ LongLongStruct::LongLongStruct( } LongLongStruct::LongLongStruct( - LongLongStruct&& x) noexcept + LongLongStruct&& x) noexcept { m_my_int64 = x.m_my_int64; } @@ -1148,13 +1173,8 @@ bool LongLongStruct::operator !=( size_t LongLongStruct::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return LongLongStruct_max_cdr_typesize; } size_t LongLongStruct::getCdrSerializedSize( @@ -1215,14 +1235,12 @@ int64_t& LongLongStruct::my_int64() } + size_t LongLongStruct::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - return current_align; + static_cast(current_alignment); + return LongLongStruct_max_key_cdr_typesize; } bool LongLongStruct::isKeyDefined() @@ -1234,12 +1252,11 @@ void LongLongStruct::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - } UShortStruct::UShortStruct() { - // m_my_uint16 com.eprosima.idl.parser.typecode.PrimitiveTypeCode@4a87761d + // unsigned short m_my_uint16 m_my_uint16 = 0; // Just to register all known types @@ -1257,7 +1274,7 @@ UShortStruct::UShortStruct( } UShortStruct::UShortStruct( - UShortStruct&& x) noexcept + UShortStruct&& x) noexcept { m_my_uint16 = x.m_my_uint16; } @@ -1296,13 +1313,8 @@ bool UShortStruct::operator !=( size_t UShortStruct::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); - - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return UShortStruct_max_cdr_typesize; } size_t UShortStruct::getCdrSerializedSize( @@ -1363,14 +1375,12 @@ uint16_t& UShortStruct::my_uint16() } + size_t UShortStruct::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - return current_align; + static_cast(current_alignment); + return UShortStruct_max_key_cdr_typesize; } bool UShortStruct::isKeyDefined() @@ -1382,12 +1392,11 @@ void UShortStruct::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - } ULongStruct::ULongStruct() { - // m_my_uint32 com.eprosima.idl.parser.typecode.PrimitiveTypeCode@37374a5e + // unsigned long m_my_uint32 m_my_uint32 = 0; // Just to register all known types @@ -1405,7 +1414,7 @@ ULongStruct::ULongStruct( } ULongStruct::ULongStruct( - ULongStruct&& x) noexcept + ULongStruct&& x) noexcept { m_my_uint32 = x.m_my_uint32; } @@ -1444,13 +1453,8 @@ bool ULongStruct::operator !=( size_t ULongStruct::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return ULongStruct_max_cdr_typesize; } size_t ULongStruct::getCdrSerializedSize( @@ -1511,14 +1515,12 @@ uint32_t& ULongStruct::my_uint32() } + size_t ULongStruct::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - return current_align; + static_cast(current_alignment); + return ULongStruct_max_key_cdr_typesize; } bool ULongStruct::isKeyDefined() @@ -1530,12 +1532,11 @@ void ULongStruct::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - } ULongLongStruct::ULongLongStruct() { - // m_my_uint64 com.eprosima.idl.parser.typecode.PrimitiveTypeCode@b7dd107 + // unsigned long long m_my_uint64 m_my_uint64 = 0; // Just to register all known types @@ -1553,7 +1554,7 @@ ULongLongStruct::ULongLongStruct( } ULongLongStruct::ULongLongStruct( - ULongLongStruct&& x) noexcept + ULongLongStruct&& x) noexcept { m_my_uint64 = x.m_my_uint64; } @@ -1592,13 +1593,8 @@ bool ULongLongStruct::operator !=( size_t ULongLongStruct::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return ULongLongStruct_max_cdr_typesize; } size_t ULongLongStruct::getCdrSerializedSize( @@ -1659,14 +1655,12 @@ uint64_t& ULongLongStruct::my_uint64() } + size_t ULongLongStruct::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - return current_align; + static_cast(current_alignment); + return ULongLongStruct_max_key_cdr_typesize; } bool ULongLongStruct::isKeyDefined() @@ -1678,12 +1672,11 @@ void ULongLongStruct::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - } FloatStruct::FloatStruct() { - // m_my_float32 com.eprosima.idl.parser.typecode.PrimitiveTypeCode@192d3247 + // float m_my_float32 m_my_float32 = 0.0; // Just to register all known types @@ -1701,7 +1694,7 @@ FloatStruct::FloatStruct( } FloatStruct::FloatStruct( - FloatStruct&& x) noexcept + FloatStruct&& x) noexcept { m_my_float32 = x.m_my_float32; } @@ -1740,13 +1733,8 @@ bool FloatStruct::operator !=( size_t FloatStruct::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return FloatStruct_max_cdr_typesize; } size_t FloatStruct::getCdrSerializedSize( @@ -1807,14 +1795,12 @@ float& FloatStruct::my_float32() } + size_t FloatStruct::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - return current_align; + static_cast(current_alignment); + return FloatStruct_max_key_cdr_typesize; } bool FloatStruct::isKeyDefined() @@ -1826,12 +1812,11 @@ void FloatStruct::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - } DoubleStruct::DoubleStruct() { - // m_my_float64 com.eprosima.idl.parser.typecode.PrimitiveTypeCode@569cfc36 + // double m_my_float64 m_my_float64 = 0.0; // Just to register all known types @@ -1849,7 +1834,7 @@ DoubleStruct::DoubleStruct( } DoubleStruct::DoubleStruct( - DoubleStruct&& x) noexcept + DoubleStruct&& x) noexcept { m_my_float64 = x.m_my_float64; } @@ -1888,13 +1873,8 @@ bool DoubleStruct::operator !=( size_t DoubleStruct::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return DoubleStruct_max_cdr_typesize; } size_t DoubleStruct::getCdrSerializedSize( @@ -1955,14 +1935,12 @@ double& DoubleStruct::my_float64() } + size_t DoubleStruct::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - return current_align; + static_cast(current_alignment); + return DoubleStruct_max_key_cdr_typesize; } bool DoubleStruct::isKeyDefined() @@ -1974,12 +1952,11 @@ void DoubleStruct::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - } LongDoubleStruct::LongDoubleStruct() { - // m_my_float128 com.eprosima.idl.parser.typecode.PrimitiveTypeCode@43bd930a + // long double m_my_float128 m_my_float128 = 0.0; // Just to register all known types @@ -1997,7 +1974,7 @@ LongDoubleStruct::LongDoubleStruct( } LongDoubleStruct::LongDoubleStruct( - LongDoubleStruct&& x) noexcept + LongDoubleStruct&& x) noexcept { m_my_float128 = x.m_my_float128; } @@ -2036,13 +2013,8 @@ bool LongDoubleStruct::operator !=( size_t LongDoubleStruct::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += 16 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); // 128 bits, but aligned as 64 - - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return LongDoubleStruct_max_cdr_typesize; } size_t LongDoubleStruct::getCdrSerializedSize( @@ -2103,14 +2075,12 @@ long double& LongDoubleStruct::my_float128() } + size_t LongDoubleStruct::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - return current_align; + static_cast(current_alignment); + return LongDoubleStruct_max_key_cdr_typesize; } bool LongDoubleStruct::isKeyDefined() @@ -2122,12 +2092,11 @@ void LongDoubleStruct::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - } CharStruct::CharStruct() { - // m_my_char com.eprosima.idl.parser.typecode.PrimitiveTypeCode@64f6106c + // char m_my_char m_my_char = 0; // Just to register all known types @@ -2145,7 +2114,7 @@ CharStruct::CharStruct( } CharStruct::CharStruct( - CharStruct&& x) noexcept + CharStruct&& x) noexcept { m_my_char = x.m_my_char; } @@ -2184,13 +2153,8 @@ bool CharStruct::operator !=( size_t CharStruct::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return CharStruct_max_cdr_typesize; } size_t CharStruct::getCdrSerializedSize( @@ -2251,14 +2215,12 @@ char& CharStruct::my_char() } + size_t CharStruct::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - return current_align; + static_cast(current_alignment); + return CharStruct_max_key_cdr_typesize; } bool CharStruct::isKeyDefined() @@ -2270,12 +2232,11 @@ void CharStruct::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - } WCharStruct::WCharStruct() { - // m_my_wchar com.eprosima.idl.parser.typecode.PrimitiveTypeCode@cb0ed20 + // wchar m_my_wchar m_my_wchar = 0; // Just to register all known types @@ -2293,7 +2254,7 @@ WCharStruct::WCharStruct( } WCharStruct::WCharStruct( - WCharStruct&& x) noexcept + WCharStruct&& x) noexcept { m_my_wchar = x.m_my_wchar; } @@ -2332,13 +2293,8 @@ bool WCharStruct::operator !=( size_t WCharStruct::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return WCharStruct_max_cdr_typesize; } size_t WCharStruct::getCdrSerializedSize( @@ -2399,14 +2355,12 @@ wchar_t& WCharStruct::my_wchar() } + size_t WCharStruct::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - return current_align; + static_cast(current_alignment); + return WCharStruct_max_key_cdr_typesize; } bool WCharStruct::isKeyDefined() @@ -2418,12 +2372,11 @@ void WCharStruct::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - } StringStruct::StringStruct() { - // m_my_string com.eprosima.idl.parser.typecode.StringTypeCode@543c6f6d + // string m_my_string m_my_string =""; // Just to register all known types @@ -2441,7 +2394,7 @@ StringStruct::StringStruct( } StringStruct::StringStruct( - StringStruct&& x) noexcept + StringStruct&& x) noexcept { m_my_string = std::move(x.m_my_string); } @@ -2480,12 +2433,8 @@ bool StringStruct::operator !=( size_t StringStruct::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + 255 + 1; - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return StringStruct_max_cdr_typesize; } size_t StringStruct::getCdrSerializedSize( @@ -2553,14 +2502,12 @@ std::string& StringStruct::my_string() return m_my_string; } + size_t StringStruct::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - return current_align; + static_cast(current_alignment); + return StringStruct_max_key_cdr_typesize; } bool StringStruct::isKeyDefined() @@ -2572,12 +2519,11 @@ void StringStruct::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - } WStringStruct::WStringStruct() { - // m_my_wstring com.eprosima.idl.parser.typecode.StringTypeCode@7403c468 + // wstring m_my_wstring // Just to register all known types @@ -2595,7 +2541,7 @@ WStringStruct::WStringStruct( } WStringStruct::WStringStruct( - WStringStruct&& x) noexcept + WStringStruct&& x) noexcept { m_my_wstring = std::move(x.m_my_wstring); } @@ -2634,12 +2580,8 @@ bool WStringStruct::operator !=( size_t WStringStruct::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + (255) * 4; // 32 bits - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return WStringStruct_max_cdr_typesize; } size_t WStringStruct::getCdrSerializedSize( @@ -2708,14 +2650,12 @@ std::wstring& WStringStruct::my_wstring() return m_my_wstring; } + size_t WStringStruct::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - return current_align; + static_cast(current_alignment); + return WStringStruct_max_key_cdr_typesize; } bool WStringStruct::isKeyDefined() @@ -2727,12 +2667,11 @@ void WStringStruct::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - } LargeStringStruct::LargeStringStruct() { - // m_my_large_string com.eprosima.idl.parser.typecode.StringTypeCode@c81cdd1 + // string m_my_large_string m_my_large_string =""; // Just to register all known types @@ -2750,7 +2689,7 @@ LargeStringStruct::LargeStringStruct( } LargeStringStruct::LargeStringStruct( - LargeStringStruct&& x) noexcept + LargeStringStruct&& x) noexcept { m_my_large_string = std::move(x.m_my_large_string); } @@ -2789,12 +2728,8 @@ bool LargeStringStruct::operator !=( size_t LargeStringStruct::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + 41925 + 1; - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return LargeStringStruct_max_cdr_typesize; } size_t LargeStringStruct::getCdrSerializedSize( @@ -2866,14 +2801,12 @@ eprosima::fastrtps::fixed_string<41925>& LargeStringStruct::my_large_string() return m_my_large_string; } + size_t LargeStringStruct::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - return current_align; + static_cast(current_alignment); + return LargeStringStruct_max_key_cdr_typesize; } bool LargeStringStruct::isKeyDefined() @@ -2885,12 +2818,11 @@ void LargeStringStruct::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - } LargeWStringStruct::LargeWStringStruct() { - // m_my_large_wstring com.eprosima.idl.parser.typecode.StringTypeCode@2a70a3d8 + // wstring m_my_large_wstring // Just to register all known types @@ -2908,7 +2840,7 @@ LargeWStringStruct::LargeWStringStruct( } LargeWStringStruct::LargeWStringStruct( - LargeWStringStruct&& x) noexcept + LargeWStringStruct&& x) noexcept { m_my_large_wstring = std::move(x.m_my_large_wstring); } @@ -2947,12 +2879,8 @@ bool LargeWStringStruct::operator !=( size_t LargeWStringStruct::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + (41925) * 4; // 32 bits - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return LargeWStringStruct_max_cdr_typesize; } size_t LargeWStringStruct::getCdrSerializedSize( @@ -3021,14 +2949,12 @@ std::wstring& LargeWStringStruct::my_large_wstring() return m_my_large_wstring; } + size_t LargeWStringStruct::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - return current_align; + static_cast(current_alignment); + return LargeWStringStruct_max_key_cdr_typesize; } bool LargeWStringStruct::isKeyDefined() @@ -3040,12 +2966,11 @@ void LargeWStringStruct::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - } ArraytStruct::ArraytStruct() { - // m_my_array com.eprosima.idl.parser.typecode.ArrayTypeCode@3891771e + // long m_my_array memset(&m_my_array, 0, (2 * 2 * 2) * 4); // Just to register all known types @@ -3063,7 +2988,7 @@ ArraytStruct::ArraytStruct( } ArraytStruct::ArraytStruct( - ArraytStruct&& x) noexcept + ArraytStruct&& x) noexcept { m_my_array = std::move(x.m_my_array); } @@ -3102,13 +3027,8 @@ bool ArraytStruct::operator !=( size_t ArraytStruct::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += ((2 * 2 * 2) * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return ArraytStruct_max_cdr_typesize; } size_t ArraytStruct::getCdrSerializedSize( @@ -3118,7 +3038,6 @@ size_t ArraytStruct::getCdrSerializedSize( (void)data; size_t initial_alignment = current_alignment; - current_alignment += ((2 * 2 * 2) * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); return current_alignment - initial_alignment; @@ -3179,14 +3098,12 @@ std::array, 2>, 2>& ArraytStruct::my_array() return m_my_array; } + size_t ArraytStruct::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - return current_align; + static_cast(current_alignment); + return ArraytStruct_max_key_cdr_typesize; } bool ArraytStruct::isKeyDefined() @@ -3198,13 +3115,12 @@ void ArraytStruct::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - } ArrayArrayStruct::ArrayArrayStruct() { - // m_my_array_array com.eprosima.idl.parser.typecode.ArrayTypeCode@18bf3d14 + // MyArray m_my_array_array // Just to register all known types @@ -3222,7 +3138,7 @@ ArrayArrayStruct::ArrayArrayStruct( } ArrayArrayStruct::ArrayArrayStruct( - ArrayArrayStruct&& x) noexcept + ArrayArrayStruct&& x) noexcept { m_my_array_array = std::move(x.m_my_array_array); } @@ -3261,16 +3177,8 @@ bool ArrayArrayStruct::operator !=( size_t ArrayArrayStruct::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - - for(size_t a = 0; a < (2 * 2); ++a) - { - current_alignment += ((2 * 2) * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - } - return current_alignment - initial_alignment; + static_cast(current_alignment); + return ArrayArrayStruct_max_cdr_typesize; } size_t ArrayArrayStruct::getCdrSerializedSize( @@ -3287,7 +3195,7 @@ size_t ArrayArrayStruct::getCdrSerializedSize( for(size_t b = 0; b < data.my_array_array().at(a).size(); ++b) { - current_alignment += ((2 * 2) * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + current_alignment += ((2 * 2) * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); } } return current_alignment - initial_alignment; @@ -3348,14 +3256,12 @@ std::array, 2>& ArrayArrayStruct::my_array_array() return m_my_array_array; } + size_t ArrayArrayStruct::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - return current_align; + static_cast(current_alignment); + return ArrayArrayStruct_max_key_cdr_typesize; } bool ArrayArrayStruct::isKeyDefined() @@ -3367,12 +3273,11 @@ void ArrayArrayStruct::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - } SequenceStruct::SequenceStruct() { - // m_my_sequence com.eprosima.idl.parser.typecode.SequenceTypeCode@5fdba6f9 + // sequence m_my_sequence // Just to register all known types @@ -3390,7 +3295,7 @@ SequenceStruct::SequenceStruct( } SequenceStruct::SequenceStruct( - SequenceStruct&& x) noexcept + SequenceStruct&& x) noexcept { m_my_sequence = std::move(x.m_my_sequence); } @@ -3429,16 +3334,8 @@ bool SequenceStruct::operator !=( size_t SequenceStruct::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - current_alignment += (2 * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return SequenceStruct_max_cdr_typesize; } size_t SequenceStruct::getCdrSerializedSize( @@ -3512,14 +3409,12 @@ std::vector& SequenceStruct::my_sequence() return m_my_sequence; } + size_t SequenceStruct::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - return current_align; + static_cast(current_alignment); + return SequenceStruct_max_key_cdr_typesize; } bool SequenceStruct::isKeyDefined() @@ -3531,12 +3426,11 @@ void SequenceStruct::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - } SequenceSequenceStruct::SequenceSequenceStruct() { - // m_my_sequence_sequence com.eprosima.idl.parser.typecode.SequenceTypeCode@f4168b8 + // sequence, 3> m_my_sequence_sequence // Just to register all known types @@ -3554,7 +3448,7 @@ SequenceSequenceStruct::SequenceSequenceStruct( } SequenceSequenceStruct::SequenceSequenceStruct( - SequenceSequenceStruct&& x) noexcept + SequenceSequenceStruct&& x) noexcept { m_my_sequence_sequence = std::move(x.m_my_sequence_sequence); } @@ -3593,22 +3487,8 @@ bool SequenceSequenceStruct::operator !=( size_t SequenceSequenceStruct::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - for(size_t a = 0; a < 3; ++a) - { - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - current_alignment += (2 * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - } - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return SequenceSequenceStruct_max_cdr_typesize; } size_t SequenceSequenceStruct::getCdrSerializedSize( @@ -3688,14 +3568,12 @@ std::vector>& SequenceSequenceStruct::my_sequence_sequence( return m_my_sequence_sequence; } + size_t SequenceSequenceStruct::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - return current_align; + static_cast(current_alignment); + return SequenceSequenceStruct_max_key_cdr_typesize; } bool SequenceSequenceStruct::isKeyDefined() @@ -3707,12 +3585,11 @@ void SequenceSequenceStruct::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - } MapStruct::MapStruct() { - // m_my_map com.eprosima.idl.parser.typecode.MapTypeCode@74294adb + // map m_my_map // Just to register all known types @@ -3730,7 +3607,7 @@ MapStruct::MapStruct( } MapStruct::MapStruct( - MapStruct&& x) noexcept + MapStruct&& x) noexcept { m_my_map = std::move(x.m_my_map); } @@ -3769,23 +3646,8 @@ bool MapStruct::operator !=( size_t MapStruct::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - for(size_t a = 0; a < 2; ++a) - { - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - } - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return MapStruct_max_cdr_typesize; } size_t MapStruct::getCdrSerializedSize( @@ -3862,14 +3724,12 @@ std::map& MapStruct::my_map() return m_my_map; } + size_t MapStruct::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - return current_align; + static_cast(current_alignment); + return MapStruct_max_key_cdr_typesize; } bool MapStruct::isKeyDefined() @@ -3881,12 +3741,11 @@ void MapStruct::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - } MapMapStruct::MapMapStruct() { - // m_my_map_map com.eprosima.idl.parser.typecode.MapTypeCode@70a9f84e + // map> m_my_map_map // Just to register all known types @@ -3904,7 +3763,7 @@ MapMapStruct::MapMapStruct( } MapMapStruct::MapMapStruct( - MapMapStruct&& x) noexcept + MapMapStruct&& x) noexcept { m_my_map_map = std::move(x.m_my_map_map); } @@ -3943,32 +3802,8 @@ bool MapMapStruct::operator !=( size_t MapMapStruct::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - for(size_t a = 0; a < 2; ++a) - { - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - for(size_t b = 0; b < 2; ++b) - { - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - } - } - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return MapMapStruct_max_cdr_typesize; } size_t MapMapStruct::getCdrSerializedSize( @@ -4054,14 +3889,12 @@ std::map>& MapMapStruct::my_map_map() return m_my_map_map; } + size_t MapMapStruct::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - return current_align; + static_cast(current_alignment); + return MapMapStruct_max_key_cdr_typesize; } bool MapMapStruct::isKeyDefined() @@ -4073,7 +3906,6 @@ void MapMapStruct::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - } MyBitset::MyBitset() @@ -4093,7 +3925,7 @@ MyBitset::MyBitset( } MyBitset::MyBitset( - MyBitset&& x) noexcept + MyBitset&& x) noexcept { m_bitset = x.m_bitset; } @@ -4129,23 +3961,6 @@ bool MyBitset::operator !=( return !(*this == x); } -size_t MyBitset::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - - return current_alignment - initial_alignment; -} - size_t MyBitset::getCdrSerializedSize( const MyBitset& , size_t current_alignment) @@ -4235,7 +4050,7 @@ uint32_t MyBitset::b() const BitsetStruct::BitsetStruct() { - // m_a com.eprosima.idl.parser.typecode.BitsetTypeCode@10b48321 + // MyBitset m_a // Just to register all known types @@ -4253,7 +4068,7 @@ BitsetStruct::BitsetStruct( } BitsetStruct::BitsetStruct( - BitsetStruct&& x) noexcept + BitsetStruct&& x) noexcept { m_a = std::move(x.m_a); } @@ -4292,12 +4107,8 @@ bool BitsetStruct::operator !=( size_t BitsetStruct::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += MyBitset::getMaxCdrSerializedSize(current_alignment); - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return BitsetStruct_max_cdr_typesize; } size_t BitsetStruct::getCdrSerializedSize( @@ -4366,14 +4177,12 @@ MyBitset& BitsetStruct::a() return m_a; } + size_t BitsetStruct::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - return current_align; + static_cast(current_alignment); + return BitsetStruct_max_key_cdr_typesize; } bool BitsetStruct::isKeyDefined() @@ -4385,14 +4194,13 @@ void BitsetStruct::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - } StructStruct::StructStruct() { - // m_a com.eprosima.idl.parser.typecode.PrimitiveTypeCode@6b67034 + // long m_a m_a = 0; - // m_b com.eprosima.idl.parser.typecode.PrimitiveTypeCode@16267862 + // long long m_b m_b = 0; // Just to register all known types @@ -4413,7 +4221,7 @@ StructStruct::StructStruct( } StructStruct::StructStruct( - StructStruct&& x) noexcept + StructStruct&& x) noexcept { m_a = x.m_a; m_b = x.m_b; @@ -4455,17 +4263,8 @@ bool StructStruct::operator !=( size_t StructStruct::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return StructStruct_max_cdr_typesize; } size_t StructStruct::getCdrSerializedSize( @@ -4560,16 +4359,12 @@ int64_t& StructStruct::b() } + size_t StructStruct::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - - - return current_align; + static_cast(current_alignment); + return StructStruct_max_key_cdr_typesize; } bool StructStruct::isKeyDefined() @@ -4581,14 +4376,13 @@ void StructStruct::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - } StructStructStruct::StructStructStruct() { - // m_child_struct com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@453da22c + // StructStruct m_child_struct - // m_child_int64 com.eprosima.idl.parser.typecode.PrimitiveTypeCode@71248c21 + // long long m_child_int64 m_child_int64 = 0; // Just to register all known types @@ -4609,7 +4403,7 @@ StructStructStruct::StructStructStruct( } StructStructStruct::StructStructStruct( - StructStructStruct&& x) noexcept + StructStructStruct&& x) noexcept { m_child_struct = std::move(x.m_child_struct); m_child_int64 = x.m_child_int64; @@ -4651,15 +4445,8 @@ bool StructStructStruct::operator !=( size_t StructStructStruct::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += StructStruct::getMaxCdrSerializedSize(current_alignment); - current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return StructStructStruct_max_cdr_typesize; } size_t StructStructStruct::getCdrSerializedSize( @@ -4761,16 +4548,12 @@ int64_t& StructStructStruct::child_int64() } + size_t StructStructStruct::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - - - return current_align; + static_cast(current_alignment); + return StructStructStruct_max_key_cdr_typesize; } bool StructStructStruct::isKeyDefined() @@ -4782,15 +4565,14 @@ void StructStructStruct::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - } SimpleUnion::SimpleUnion() { m__d = A; - // m_first com.eprosima.idl.parser.typecode.PrimitiveTypeCode@15d9bc04 + // long m_first m_first = 0; - // m_second com.eprosima.idl.parser.typecode.PrimitiveTypeCode@473b46c3 + // long long m_second m_second = 0; } @@ -5042,38 +4824,6 @@ int64_t& SimpleUnion::second() return m_second; } -size_t SimpleUnion::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - size_t reset_alignment = 0; - size_t union_max_size_serialized = 0; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - reset_alignment = current_alignment; - - reset_alignment += 4 + eprosima::fastcdr::Cdr::alignment(reset_alignment, 4); - - - if(union_max_size_serialized < reset_alignment) - union_max_size_serialized = reset_alignment; - - - reset_alignment = current_alignment; - - reset_alignment += 8 + eprosima::fastcdr::Cdr::alignment(reset_alignment, 8); - - - if(union_max_size_serialized < reset_alignment) - union_max_size_serialized = reset_alignment; - - - - return union_max_size_serialized - initial_alignment; -} - // TODO(Ricardo) Review size_t SimpleUnion::getCdrSerializedSize( const SimpleUnion& data, @@ -5143,9 +4893,9 @@ void SimpleUnion::deserialize( UnionUnion::UnionUnion() { m__d = A; - // m_first com.eprosima.idl.parser.typecode.PrimitiveTypeCode@797badd3 + // long m_first m_first = 0; - // m_second com.eprosima.idl.parser.typecode.UnionTypeCode@77be656f + // SimpleUnion m_second } @@ -5404,37 +5154,6 @@ SimpleUnion& UnionUnion::second() return m_second; } -size_t UnionUnion::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - size_t reset_alignment = 0; - size_t union_max_size_serialized = 0; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - reset_alignment = current_alignment; - - reset_alignment += 4 + eprosima::fastcdr::Cdr::alignment(reset_alignment, 4); - - - if(union_max_size_serialized < reset_alignment) - union_max_size_serialized = reset_alignment; - - - reset_alignment = current_alignment; - - reset_alignment += SimpleUnion::getMaxCdrSerializedSize(reset_alignment); - - if(union_max_size_serialized < reset_alignment) - union_max_size_serialized = reset_alignment; - - - - return union_max_size_serialized - initial_alignment; -} - // TODO(Ricardo) Review size_t UnionUnion::getCdrSerializedSize( const UnionUnion& data, @@ -5503,9 +5222,9 @@ void UnionUnion::deserialize( WCharUnion::WCharUnion() { m__d = A; - // m_first com.eprosima.idl.parser.typecode.PrimitiveTypeCode@62bd765 + // long m_first m_first = 0; - // m_second com.eprosima.idl.parser.typecode.PrimitiveTypeCode@23a5fd2 + // long long m_second m_second = 0; } @@ -5757,38 +5476,6 @@ int64_t& WCharUnion::second() return m_second; } -size_t WCharUnion::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - size_t reset_alignment = 0; - size_t union_max_size_serialized = 0; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - reset_alignment = current_alignment; - - reset_alignment += 4 + eprosima::fastcdr::Cdr::alignment(reset_alignment, 4); - - - if(union_max_size_serialized < reset_alignment) - union_max_size_serialized = reset_alignment; - - - reset_alignment = current_alignment; - - reset_alignment += 8 + eprosima::fastcdr::Cdr::alignment(reset_alignment, 8); - - - if(union_max_size_serialized < reset_alignment) - union_max_size_serialized = reset_alignment; - - - - return union_max_size_serialized - initial_alignment; -} - // TODO(Ricardo) Review size_t WCharUnion::getCdrSerializedSize( const WCharUnion& data, @@ -5857,7 +5544,7 @@ void WCharUnion::deserialize( SimpleUnionStruct::SimpleUnionStruct() { - // m_my_union com.eprosima.idl.parser.typecode.UnionTypeCode@77be656f + // SimpleUnion m_my_union // Just to register all known types @@ -5875,7 +5562,7 @@ SimpleUnionStruct::SimpleUnionStruct( } SimpleUnionStruct::SimpleUnionStruct( - SimpleUnionStruct&& x) noexcept + SimpleUnionStruct&& x) noexcept { m_my_union = std::move(x.m_my_union); } @@ -5914,12 +5601,8 @@ bool SimpleUnionStruct::operator !=( size_t SimpleUnionStruct::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += SimpleUnion::getMaxCdrSerializedSize(current_alignment); - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return SimpleUnionStruct_max_cdr_typesize; } size_t SimpleUnionStruct::getCdrSerializedSize( @@ -5988,14 +5671,12 @@ SimpleUnion& SimpleUnionStruct::my_union() return m_my_union; } + size_t SimpleUnionStruct::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - return current_align; + static_cast(current_alignment); + return SimpleUnionStruct_max_key_cdr_typesize; } bool SimpleUnionStruct::isKeyDefined() @@ -6007,12 +5688,11 @@ void SimpleUnionStruct::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - } UnionUnionUnionStruct::UnionUnionUnionStruct() { - // m_my_union com.eprosima.idl.parser.typecode.UnionTypeCode@dd3b207 + // UnionUnion m_my_union // Just to register all known types @@ -6030,7 +5710,7 @@ UnionUnionUnionStruct::UnionUnionUnionStruct( } UnionUnionUnionStruct::UnionUnionUnionStruct( - UnionUnionUnionStruct&& x) noexcept + UnionUnionUnionStruct&& x) noexcept { m_my_union = std::move(x.m_my_union); } @@ -6069,12 +5749,8 @@ bool UnionUnionUnionStruct::operator !=( size_t UnionUnionUnionStruct::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += UnionUnion::getMaxCdrSerializedSize(current_alignment); - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return UnionUnionUnionStruct_max_cdr_typesize; } size_t UnionUnionUnionStruct::getCdrSerializedSize( @@ -6143,14 +5819,12 @@ UnionUnion& UnionUnionUnionStruct::my_union() return m_my_union; } + size_t UnionUnionUnionStruct::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - return current_align; + static_cast(current_alignment); + return UnionUnionUnionStruct_max_key_cdr_typesize; } bool UnionUnionUnionStruct::isKeyDefined() @@ -6162,12 +5836,11 @@ void UnionUnionUnionStruct::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - } WCharUnionStruct::WCharUnionStruct() { - // m_my_union com.eprosima.idl.parser.typecode.UnionTypeCode@551bdc27 + // WCharUnion m_my_union // Just to register all known types @@ -6185,7 +5858,7 @@ WCharUnionStruct::WCharUnionStruct( } WCharUnionStruct::WCharUnionStruct( - WCharUnionStruct&& x) noexcept + WCharUnionStruct&& x) noexcept { m_my_union = std::move(x.m_my_union); } @@ -6224,12 +5897,8 @@ bool WCharUnionStruct::operator !=( size_t WCharUnionStruct::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += WCharUnion::getMaxCdrSerializedSize(current_alignment); - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return WCharUnionStruct_max_cdr_typesize; } size_t WCharUnionStruct::getCdrSerializedSize( @@ -6298,14 +5967,12 @@ WCharUnion& WCharUnionStruct::my_union() return m_my_union; } + size_t WCharUnionStruct::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - return current_align; + static_cast(current_alignment); + return WCharUnionStruct_max_key_cdr_typesize; } bool WCharUnionStruct::isKeyDefined() @@ -6317,5 +5984,4 @@ void WCharUnionStruct::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - } diff --git a/test/unittest/dynamic_types/idl/Basic.h b/test/unittest/dynamic_types/idl/Basic.h index 241af9342bf..8be925f51ba 100644 --- a/test/unittest/dynamic_types/idl/Basic.h +++ b/test/unittest/dynamic_types/idl/Basic.h @@ -156,11 +156,11 @@ class EnumStruct /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -215,6 +215,7 @@ class EnumStruct private: MyEnum m_my_enum; + }; /*! * @brief This class represents the structure AliasStruct defined by the user in the IDL file. @@ -297,11 +298,11 @@ class AliasStruct /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -356,6 +357,7 @@ class AliasStruct private: MyAliasEnum m_my_alias; + }; /*! * @brief This class represents the structure AliasAliasStruct defined by the user in the IDL file. @@ -438,11 +440,11 @@ class AliasAliasStruct /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -497,6 +499,7 @@ class AliasAliasStruct private: MyAliasAliasEnum m_my_alias_alias; + }; /*! * @brief This class represents the structure BoolStruct defined by the user in the IDL file. @@ -579,11 +582,11 @@ class BoolStruct /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -638,6 +641,7 @@ class BoolStruct private: bool m_my_bool; + }; /*! * @brief This class represents the structure OctetStruct defined by the user in the IDL file. @@ -720,11 +724,11 @@ class OctetStruct /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -779,6 +783,7 @@ class OctetStruct private: uint8_t m_my_octet; + }; /*! * @brief This class represents the structure ShortStruct defined by the user in the IDL file. @@ -861,11 +866,11 @@ class ShortStruct /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -920,6 +925,7 @@ class ShortStruct private: int16_t m_my_int16; + }; /*! * @brief This class represents the structure LongStruct defined by the user in the IDL file. @@ -1002,11 +1008,11 @@ class LongStruct /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -1061,6 +1067,7 @@ class LongStruct private: int32_t m_my_int32; + }; /*! * @brief This class represents the structure LongLongStruct defined by the user in the IDL file. @@ -1143,11 +1150,11 @@ class LongLongStruct /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -1202,6 +1209,7 @@ class LongLongStruct private: int64_t m_my_int64; + }; /*! * @brief This class represents the structure UShortStruct defined by the user in the IDL file. @@ -1284,11 +1292,11 @@ class UShortStruct /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -1343,6 +1351,7 @@ class UShortStruct private: uint16_t m_my_uint16; + }; /*! * @brief This class represents the structure ULongStruct defined by the user in the IDL file. @@ -1425,11 +1434,11 @@ class ULongStruct /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -1484,6 +1493,7 @@ class ULongStruct private: uint32_t m_my_uint32; + }; /*! * @brief This class represents the structure ULongLongStruct defined by the user in the IDL file. @@ -1566,11 +1576,11 @@ class ULongLongStruct /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -1625,6 +1635,7 @@ class ULongLongStruct private: uint64_t m_my_uint64; + }; /*! * @brief This class represents the structure FloatStruct defined by the user in the IDL file. @@ -1707,11 +1718,11 @@ class FloatStruct /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -1766,6 +1777,7 @@ class FloatStruct private: float m_my_float32; + }; /*! * @brief This class represents the structure DoubleStruct defined by the user in the IDL file. @@ -1848,11 +1860,11 @@ class DoubleStruct /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -1907,6 +1919,7 @@ class DoubleStruct private: double m_my_float64; + }; /*! * @brief This class represents the structure LongDoubleStruct defined by the user in the IDL file. @@ -1989,11 +2002,11 @@ class LongDoubleStruct /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -2048,6 +2061,7 @@ class LongDoubleStruct private: long double m_my_float128; + }; /*! * @brief This class represents the structure CharStruct defined by the user in the IDL file. @@ -2130,11 +2144,11 @@ class CharStruct /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -2189,6 +2203,7 @@ class CharStruct private: char m_my_char; + }; /*! * @brief This class represents the structure WCharStruct defined by the user in the IDL file. @@ -2271,11 +2286,11 @@ class WCharStruct /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -2330,6 +2345,7 @@ class WCharStruct private: wchar_t m_my_wchar; + }; /*! * @brief This class represents the structure StringStruct defined by the user in the IDL file. @@ -2418,11 +2434,11 @@ class StringStruct eProsima_user_DllExport std::string& my_string(); /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -2477,6 +2493,7 @@ class StringStruct private: std::string m_my_string; + }; /*! * @brief This class represents the structure WStringStruct defined by the user in the IDL file. @@ -2565,11 +2582,11 @@ class WStringStruct eProsima_user_DllExport std::wstring& my_wstring(); /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -2624,6 +2641,7 @@ class WStringStruct private: std::wstring m_my_wstring; + }; /*! * @brief This class represents the structure LargeStringStruct defined by the user in the IDL file. @@ -2712,11 +2730,11 @@ class LargeStringStruct eProsima_user_DllExport eprosima::fastrtps::fixed_string<41925>& my_large_string(); /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -2771,6 +2789,7 @@ class LargeStringStruct private: eprosima::fastrtps::fixed_string<41925> m_my_large_string; + }; /*! * @brief This class represents the structure LargeWStringStruct defined by the user in the IDL file. @@ -2859,11 +2878,11 @@ class LargeWStringStruct eProsima_user_DllExport std::wstring& my_large_wstring(); /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -2918,6 +2937,7 @@ class LargeWStringStruct private: std::wstring m_my_large_wstring; + }; /*! * @brief This class represents the structure ArraytStruct defined by the user in the IDL file. @@ -3006,11 +3026,11 @@ class ArraytStruct eProsima_user_DllExport std::array, 2>, 2>& my_array(); /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -3065,6 +3085,7 @@ class ArraytStruct private: std::array, 2>, 2> m_my_array; + }; typedef std::array, 2> MyArray; /*! @@ -3154,11 +3175,11 @@ class ArrayArrayStruct eProsima_user_DllExport std::array, 2>& my_array_array(); /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -3213,6 +3234,7 @@ class ArrayArrayStruct private: std::array, 2> m_my_array_array; + }; /*! * @brief This class represents the structure SequenceStruct defined by the user in the IDL file. @@ -3301,11 +3323,11 @@ class SequenceStruct eProsima_user_DllExport std::vector& my_sequence(); /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -3360,6 +3382,7 @@ class SequenceStruct private: std::vector m_my_sequence; + }; /*! * @brief This class represents the structure SequenceSequenceStruct defined by the user in the IDL file. @@ -3448,11 +3471,11 @@ class SequenceSequenceStruct eProsima_user_DllExport std::vector>& my_sequence_sequence(); /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -3507,6 +3530,7 @@ class SequenceSequenceStruct private: std::vector> m_my_sequence_sequence; + }; /*! * @brief This class represents the structure MapStruct defined by the user in the IDL file. @@ -3595,11 +3619,11 @@ class MapStruct eProsima_user_DllExport std::map& my_map(); /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -3654,6 +3678,7 @@ class MapStruct private: std::map m_my_map; + }; /*! * @brief This class represents the structure MapMapStruct defined by the user in the IDL file. @@ -3742,11 +3767,11 @@ class MapMapStruct eProsima_user_DllExport std::map>& my_map_map(); /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -3801,6 +3826,7 @@ class MapMapStruct private: std::map> m_my_map_map; + }; /*! * @brief This class represents the structure MyBitset defined by the user in the IDL file. @@ -3888,15 +3914,6 @@ class MyBitset */ eProsima_user_DllExport uint32_t b() const; - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - /*! * @brief This function returns the serialized size of a data depending on the buffer alignment. * @param data Data which is calculated its serialized size. @@ -4016,11 +4033,11 @@ class BitsetStruct eProsima_user_DllExport MyBitset& a(); /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -4075,6 +4092,7 @@ class BitsetStruct private: MyBitset m_a; + }; /*! * @brief This class represents the structure StructStruct defined by the user in the IDL file. @@ -4176,11 +4194,11 @@ class StructStruct /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -4236,6 +4254,7 @@ class StructStruct int32_t m_a; int64_t m_b; + }; /*! * @brief This class represents the structure StructStructStruct defined by the user in the IDL file. @@ -4343,11 +4362,11 @@ class StructStructStruct /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -4403,6 +4422,7 @@ class StructStructStruct StructStruct m_child_struct; int64_t m_child_int64; + }; /*! * @brief This class represents the union SimpleUnion defined by the user in the IDL file. @@ -4527,15 +4547,6 @@ class SimpleUnion eProsima_user_DllExport int64_t& second(); - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - /*! * @brief This function returns the serialized size of a data depending on the buffer alignment. * @param data Data which is calculated its serialized size. @@ -4700,15 +4711,6 @@ class UnionUnion */ eProsima_user_DllExport SimpleUnion& second(); - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - /*! * @brief This function returns the serialized size of a data depending on the buffer alignment. * @param data Data which is calculated its serialized size. @@ -4867,15 +4869,6 @@ class WCharUnion eProsima_user_DllExport int64_t& second(); - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - /*! * @brief This function returns the serialized size of a data depending on the buffer alignment. * @param data Data which is calculated its serialized size. @@ -4998,11 +4991,11 @@ class SimpleUnionStruct eProsima_user_DllExport SimpleUnion& my_union(); /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -5057,6 +5050,7 @@ class SimpleUnionStruct private: SimpleUnion m_my_union; + }; /*! * @brief This class represents the structure UnionUnionUnionStruct defined by the user in the IDL file. @@ -5145,11 +5139,11 @@ class UnionUnionUnionStruct eProsima_user_DllExport UnionUnion& my_union(); /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -5204,6 +5198,7 @@ class UnionUnionUnionStruct private: UnionUnion m_my_union; + }; /*! * @brief This class represents the structure WCharUnionStruct defined by the user in the IDL file. @@ -5292,11 +5287,11 @@ class WCharUnionStruct eProsima_user_DllExport WCharUnion& my_union(); /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -5351,6 +5346,7 @@ class WCharUnionStruct private: WCharUnion m_my_union; + }; #endif // _FAST_DDS_GENERATED_BASIC_H_ \ No newline at end of file diff --git a/test/unittest/dynamic_types/idl/BasicPubSubTypes.h b/test/unittest/dynamic_types/idl/BasicPubSubTypes.h index 2cf4646395c..658c7b8aa55 100644 --- a/test/unittest/dynamic_types/idl/BasicPubSubTypes.h +++ b/test/unittest/dynamic_types/idl/BasicPubSubTypes.h @@ -1740,7 +1740,7 @@ class BitsetStructPubSubType : public eprosima::fastdds::dds::TopicDataType #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED eProsima_user_DllExport inline bool is_bounded() const override { - return false; + return true; } #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED @@ -1748,7 +1748,7 @@ class BitsetStructPubSubType : public eprosima::fastdds::dds::TopicDataType #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN eProsima_user_DllExport inline bool is_plain() const override { - return false; + return true; } #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN @@ -1757,8 +1757,8 @@ class BitsetStructPubSubType : public eprosima::fastdds::dds::TopicDataType eProsima_user_DllExport inline bool construct_sample( void* memory) const override { - (void)memory; - return false; + new (memory) BitsetStruct(); + return true; } #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE diff --git a/test/unittest/dynamic_types/idl/Test.cxx b/test/unittest/dynamic_types/idl/Test.cxx index 68e3f87c641..c4578587a4f 100644 --- a/test/unittest/dynamic_types/idl/Test.cxx +++ b/test/unittest/dynamic_types/idl/Test.cxx @@ -35,41 +35,72 @@ using namespace eprosima::fastcdr::exception; #include +#define KeyedStruct_max_cdr_typesize 1364ULL; + + + +#define BasicStruct_max_cdr_typesize 1356ULL; + +#define ComplexStruct_max_cdr_typesize 82991252ULL; + + +#define CompleteStruct_max_cdr_typesize 82991516ULL; + + + + + +#define KeyedStruct_max_key_cdr_typesize 1ULL; + + + +#define BasicStruct_max_key_cdr_typesize 0ULL; + +#define ComplexStruct_max_key_cdr_typesize 0ULL; + + +#define CompleteStruct_max_key_cdr_typesize 0ULL; + + + + + + BasicStruct::BasicStruct() { - // m_my_bool com.eprosima.idl.parser.typecode.PrimitiveTypeCode@76a3e297 + // boolean m_my_bool m_my_bool = false; - // m_my_octet com.eprosima.idl.parser.typecode.PrimitiveTypeCode@ed9d034 + // octet m_my_octet m_my_octet = 0; - // m_my_int16 com.eprosima.idl.parser.typecode.PrimitiveTypeCode@6121c9d6 + // short m_my_int16 m_my_int16 = 0; - // m_my_int32 com.eprosima.idl.parser.typecode.PrimitiveTypeCode@4eb7f003 + // long m_my_int32 m_my_int32 = 0; - // m_my_int64 com.eprosima.idl.parser.typecode.PrimitiveTypeCode@eafc191 + // long long m_my_int64 m_my_int64 = 0; - // m_my_uint16 com.eprosima.idl.parser.typecode.PrimitiveTypeCode@612fc6eb + // unsigned short m_my_uint16 m_my_uint16 = 0; - // m_my_uint32 com.eprosima.idl.parser.typecode.PrimitiveTypeCode@1060b431 + // unsigned long m_my_uint32 m_my_uint32 = 0; - // m_my_uint64 com.eprosima.idl.parser.typecode.PrimitiveTypeCode@612679d6 + // unsigned long long m_my_uint64 m_my_uint64 = 0; - // m_my_float32 com.eprosima.idl.parser.typecode.PrimitiveTypeCode@11758f2a + // float m_my_float32 m_my_float32 = 0.0; - // m_my_float64 com.eprosima.idl.parser.typecode.PrimitiveTypeCode@e720b71 + // double m_my_float64 m_my_float64 = 0.0; - // m_my_float128 com.eprosima.idl.parser.typecode.PrimitiveTypeCode@1b26f7b2 + // long double m_my_float128 m_my_float128 = 0.0; - // m_my_char com.eprosima.idl.parser.typecode.PrimitiveTypeCode@491cc5c9 + // char m_my_char m_my_char = 0; - // m_my_wchar com.eprosima.idl.parser.typecode.PrimitiveTypeCode@74ad1f1f + // wchar m_my_wchar m_my_wchar = 0; - // m_my_string com.eprosima.idl.parser.typecode.StringTypeCode@6a1aab78 + // string m_my_string m_my_string =""; - // m_my_wstring com.eprosima.idl.parser.typecode.StringTypeCode@462d5aee + // wstring m_my_wstring // Just to register all known types @@ -116,7 +147,7 @@ BasicStruct::BasicStruct( } BasicStruct::BasicStruct( - BasicStruct&& x) noexcept + BasicStruct&& x) noexcept { m_my_bool = x.m_my_bool; m_my_octet = x.m_my_octet; @@ -197,53 +228,8 @@ bool BasicStruct::operator !=( size_t BasicStruct::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - - current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - - current_alignment += 16 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); // 128 bits, but aligned as 64 - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + 255 + 1; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + (255) * 4; // 32 bits - - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return BasicStruct_max_cdr_typesize; } size_t BasicStruct::getCdrSerializedSize( @@ -782,29 +768,12 @@ std::wstring& BasicStruct::my_wstring() return m_my_wstring; } + size_t BasicStruct::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - - - - - - - - - - - - - - - - return current_align; + static_cast(current_alignment); + return BasicStruct_max_key_cdr_typesize; } bool BasicStruct::isKeyDefined() @@ -816,7 +785,6 @@ void BasicStruct::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - } @@ -826,49 +794,49 @@ void BasicStruct::serializeKey( ComplexStruct::ComplexStruct() { - // m_my_octet com.eprosima.idl.parser.typecode.PrimitiveTypeCode@6483f5ae + // octet m_my_octet m_my_octet = 0; - // m_my_basic_struct com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@b9afc07 + // BasicStruct m_my_basic_struct - // m_my_alias_enum com.eprosima.idl.parser.typecode.AliasTypeCode@382db087 + // MyAliasEnum m_my_alias_enum m_my_alias_enum = ::A; - // m_my_enum com.eprosima.idl.parser.typecode.EnumTypeCode@80169cf + // MyEnum m_my_enum m_my_enum = ::A; - // m_my_sequence_octet com.eprosima.idl.parser.typecode.SequenceTypeCode@5427c60c + // sequence m_my_sequence_octet - // m_my_sequence_struct com.eprosima.idl.parser.typecode.SequenceTypeCode@15bfd87 + // sequence m_my_sequence_struct - // m_my_array_octet com.eprosima.idl.parser.typecode.ArrayTypeCode@543e710e + // char m_my_array_octet memset(&m_my_array_octet, 0, (500 * 5 * 4) * 1); - // m_my_octet_array_500 com.eprosima.idl.parser.typecode.AliasTypeCode@57f23557 + // MyOctetArray500 m_my_octet_array_500 memset(&m_my_octet_array_500, 0, (500) * 1); - // m_my_array_struct com.eprosima.idl.parser.typecode.ArrayTypeCode@3d0f8e03 + // BasicStruct m_my_array_struct - // m_my_map_octet_short com.eprosima.idl.parser.typecode.MapTypeCode@6366ebe0 + // map m_my_map_octet_short - // m_my_map_long_struct com.eprosima.idl.parser.typecode.MapTypeCode@44f75083 + // map m_my_map_long_struct - // m_my_map_long_seq_octet com.eprosima.idl.parser.typecode.MapTypeCode@2698dc7 + // map>> m_my_map_long_seq_octet - // m_my_map_long_octet_array_500 com.eprosima.idl.parser.typecode.MapTypeCode@43d7741f + // map m_my_map_long_octet_array_500 - // m_my_map_long_lol_type com.eprosima.idl.parser.typecode.MapTypeCode@17baae6e + // map> m_my_map_long_lol_type - // m_my_small_string_8 com.eprosima.idl.parser.typecode.StringTypeCode@69379752 + // string m_my_small_string_8 m_my_small_string_8 =""; - // m_my_small_string_16 com.eprosima.idl.parser.typecode.StringTypeCode@27fe3806 + // wstring m_my_small_string_16 - // m_my_large_string_8 com.eprosima.idl.parser.typecode.StringTypeCode@5f71c76a + // string m_my_large_string_8 m_my_large_string_8 =""; - // m_my_large_string_16 com.eprosima.idl.parser.typecode.StringTypeCode@1d7acb34 + // wstring m_my_large_string_16 - // m_my_array_string com.eprosima.idl.parser.typecode.ArrayTypeCode@48a242ce + // string m_my_array_string - // m_multi_alias_array_42 com.eprosima.idl.parser.typecode.AliasTypeCode@1e4a7dd4 + // MA3 m_multi_alias_array_42 memset(&m_multi_alias_array_42, 0, (42) * 4); - // m_my_array_arrays com.eprosima.idl.parser.typecode.ArrayTypeCode@4f51b3e0 + // MyMiniArray m_my_array_arrays - // m_my_sequences_array com.eprosima.idl.parser.typecode.ArrayTypeCode@4b9e255 + // MySequenceLong m_my_sequences_array // Just to register all known types @@ -929,7 +897,7 @@ ComplexStruct::ComplexStruct( } ComplexStruct::ComplexStruct( - ComplexStruct&& x) noexcept + ComplexStruct&& x) noexcept { m_my_octet = x.m_my_octet; m_my_basic_struct = std::move(x.m_my_basic_struct); @@ -1031,154 +999,8 @@ bool ComplexStruct::operator !=( size_t ComplexStruct::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += BasicStruct::getMaxCdrSerializedSize(current_alignment); - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - current_alignment += (55 * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - for(size_t a = 0; a < 100; ++a) - { - current_alignment += BasicStruct::getMaxCdrSerializedSize(current_alignment);} - - current_alignment += ((500 * 5 * 4) * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += ((500) * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - - for(size_t a = 0; a < (5); ++a) - { - current_alignment += BasicStruct::getMaxCdrSerializedSize(current_alignment);} - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - for(size_t a = 0; a < 100; ++a) - { - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - - current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); - - - } - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - for(size_t a = 0; a < 100; ++a) - { - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - - current_alignment += BasicStruct::getMaxCdrSerializedSize(current_alignment); - } - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - for(size_t a = 0; a < 100; ++a) - { - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - for(size_t b = 0; b < 100; ++b) - { - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - current_alignment += (100 * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - } - } - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - for(size_t a = 0; a < 100; ++a) - { - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - - current_alignment += ((500) * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - } - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - for(size_t a = 0; a < 100; ++a) - { - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - for(size_t b = 0; b < 100; ++b) - { - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - - - for(size_t c = 0; c < (5); ++c) - { - current_alignment += BasicStruct::getMaxCdrSerializedSize(current_alignment);}} - } - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + 128 + 1; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + (64) * 4; // 32 bits - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + 500 + 1; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + (1024) * 4; // 32 bits - - - for(size_t a = 0; a < (5 * 5); ++a) - { - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + 75 + 1; - } - current_alignment += ((42) * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - - for(size_t a = 0; a < (5); ++a) - { - current_alignment += ((2) * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - } - - for(size_t a = 0; a < (23); ++a) - { - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - current_alignment += (100 * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - } - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return ComplexStruct_max_cdr_typesize; } size_t ComplexStruct::getCdrSerializedSize( @@ -1219,7 +1041,6 @@ size_t ComplexStruct::getCdrSerializedSize( current_alignment += ((500) * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - for(size_t a = 0; a < data.my_array_struct().size(); ++a) { current_alignment += BasicStruct::getCdrSerializedSize(data.my_array_struct().at(a), current_alignment); @@ -1323,12 +1144,12 @@ size_t ComplexStruct::getCdrSerializedSize( } } - current_alignment += ((42) * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + current_alignment += ((42) * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); for(size_t a = 0; a < data.my_array_arrays().size(); ++a) { - current_alignment += ((2) * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + current_alignment += ((2) * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); } for(size_t a = 0; a < data.my_sequences_array().size(); ++a) @@ -2245,36 +2066,12 @@ std::array& ComplexStruct::my_sequences_array() return m_my_sequences_array; } + size_t ComplexStruct::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - - - - - - - - - - - - - - - - - - - - - - - return current_align; + static_cast(current_alignment); + return ComplexStruct_max_key_cdr_typesize; } bool ComplexStruct::isKeyDefined() @@ -2286,15 +2083,14 @@ void ComplexStruct::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - } MyUnion::MyUnion() { m__d = ::A; - // m_basic com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@b9afc07 + // BasicStruct m_basic - // m_complex com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@166fa74d + // ComplexStruct m_complex } @@ -2569,36 +2365,6 @@ ComplexStruct& MyUnion::complex() return m_complex; } -size_t MyUnion::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - size_t reset_alignment = 0; - size_t union_max_size_serialized = 0; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - reset_alignment = current_alignment; - - reset_alignment += BasicStruct::getMaxCdrSerializedSize(reset_alignment); - - if(union_max_size_serialized < reset_alignment) - union_max_size_serialized = reset_alignment; - - - reset_alignment = current_alignment; - - reset_alignment += ComplexStruct::getMaxCdrSerializedSize(reset_alignment); - - if(union_max_size_serialized < reset_alignment) - union_max_size_serialized = reset_alignment; - - - - return union_max_size_serialized - initial_alignment; -} - // TODO(Ricardo) Review size_t MyUnion::getCdrSerializedSize( const MyUnion& data, @@ -2674,11 +2440,11 @@ void MyUnion::deserialize( MyUnion2::MyUnion2() { m__d = A; - // m_uno com.eprosima.idl.parser.typecode.PrimitiveTypeCode@7181ae3f + // long m_uno m_uno = 0; - // m_imString com.eprosima.idl.parser.typecode.StringTypeCode@46238e3f + // string m_imString m_imString =""; - // m_tres com.eprosima.idl.parser.typecode.PrimitiveTypeCode@6e2c9341 + // long m_tres m_tres = 0; } @@ -3008,46 +2774,6 @@ int32_t& MyUnion2::tres() return m_tres; } -size_t MyUnion2::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - size_t reset_alignment = 0; - size_t union_max_size_serialized = 0; - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - reset_alignment = current_alignment; - - reset_alignment += 4 + eprosima::fastcdr::Cdr::alignment(reset_alignment, 4); - - - if(union_max_size_serialized < reset_alignment) - union_max_size_serialized = reset_alignment; - - - reset_alignment = current_alignment; - - reset_alignment += 4 + eprosima::fastcdr::Cdr::alignment(reset_alignment, 4) + 255 + 1; - - if(union_max_size_serialized < reset_alignment) - union_max_size_serialized = reset_alignment; - - - reset_alignment = current_alignment; - - reset_alignment += 4 + eprosima::fastcdr::Cdr::alignment(reset_alignment, 4); - - - if(union_max_size_serialized < reset_alignment) - union_max_size_serialized = reset_alignment; - - - - return union_max_size_serialized - initial_alignment; -} - // TODO(Ricardo) Review size_t MyUnion2::getCdrSerializedSize( const MyUnion2& data, @@ -3125,9 +2851,9 @@ void MyUnion2::deserialize( CompleteStruct::CompleteStruct() { - // m_my_union com.eprosima.idl.parser.typecode.UnionTypeCode@1efee8e7 + // MyUnion m_my_union - // m_my_union_2 com.eprosima.idl.parser.typecode.UnionTypeCode@1ee807c6 + // MyUnion2 m_my_union_2 // Just to register all known types @@ -3148,7 +2874,7 @@ CompleteStruct::CompleteStruct( } CompleteStruct::CompleteStruct( - CompleteStruct&& x) noexcept + CompleteStruct&& x) noexcept { m_my_union = std::move(x.m_my_union); m_my_union_2 = std::move(x.m_my_union_2); @@ -3190,13 +2916,8 @@ bool CompleteStruct::operator !=( size_t CompleteStruct::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += MyUnion::getMaxCdrSerializedSize(current_alignment); - current_alignment += MyUnion2::getMaxCdrSerializedSize(current_alignment); - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return CompleteStruct_max_cdr_typesize; } size_t CompleteStruct::getCdrSerializedSize( @@ -3305,16 +3026,12 @@ MyUnion2& CompleteStruct::my_union_2() return m_my_union_2; } + size_t CompleteStruct::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - - - return current_align; + static_cast(current_alignment); + return CompleteStruct_max_key_cdr_typesize; } bool CompleteStruct::isKeyDefined() @@ -3326,14 +3043,13 @@ void CompleteStruct::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - } KeyedStruct::KeyedStruct() { - // m_key com.eprosima.idl.parser.typecode.PrimitiveTypeCode@32cf48b7 + // octet m_key m_key = 0; - // m_basic com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@b9afc07 + // BasicStruct m_basic // Just to register all known types @@ -3354,7 +3070,7 @@ KeyedStruct::KeyedStruct( } KeyedStruct::KeyedStruct( - KeyedStruct&& x) noexcept + KeyedStruct&& x) noexcept { m_key = x.m_key; m_basic = std::move(x.m_basic); @@ -3396,15 +3112,8 @@ bool KeyedStruct::operator !=( size_t KeyedStruct::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += BasicStruct::getMaxCdrSerializedSize(current_alignment); - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return KeyedStruct_max_cdr_typesize; } size_t KeyedStruct::getCdrSerializedSize( @@ -3506,18 +3215,12 @@ BasicStruct& KeyedStruct::basic() return m_basic; } + size_t KeyedStruct::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - current_align += 1 + eprosima::fastcdr::Cdr::alignment(current_align, 1); - - - - - return current_align; + static_cast(current_alignment); + return KeyedStruct_max_key_cdr_typesize; } bool KeyedStruct::isKeyDefined() @@ -3529,6 +3232,7 @@ void KeyedStruct::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - scdr << m_key; - + scdr << m_key; + + } diff --git a/test/unittest/dynamic_types/idl/Test.h b/test/unittest/dynamic_types/idl/Test.h index 7ba91d4bcfb..bae12a80a57 100644 --- a/test/unittest/dynamic_types/idl/Test.h +++ b/test/unittest/dynamic_types/idl/Test.h @@ -435,11 +435,11 @@ class BasicStruct eProsima_user_DllExport std::wstring& my_wstring(); /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -508,6 +508,7 @@ class BasicStruct wchar_t m_my_wchar; std::string m_my_string; std::wstring m_my_wstring; + }; typedef std::array MyOctetArray500; typedef std::array BSAlias5; @@ -1108,11 +1109,11 @@ class ComplexStruct eProsima_user_DllExport std::array& my_sequences_array(); /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -1188,6 +1189,7 @@ class ComplexStruct MA3 m_multi_alias_array_42; std::array m_my_array_arrays; std::array m_my_sequences_array; + }; /*! * @brief This class represents the union MyUnion defined by the user in the IDL file. @@ -1324,15 +1326,6 @@ class MyUnion */ eProsima_user_DllExport ComplexStruct& complex(); - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - /*! * @brief This function returns the serialized size of a data depending on the buffer alignment. * @param data Data which is calculated its serialized size. @@ -1518,15 +1511,6 @@ class MyUnion2 eProsima_user_DllExport int32_t& tres(); - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - /*! * @brief This function returns the serialized size of a data depending on the buffer alignment. * @param data Data which is calculated its serialized size. @@ -1675,11 +1659,11 @@ class CompleteStruct eProsima_user_DllExport MyUnion2& my_union_2(); /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -1735,6 +1719,7 @@ class CompleteStruct MyUnion m_my_union; MyUnion2 m_my_union_2; + }; /*! * @brief This class represents the structure KeyedStruct defined by the user in the IDL file. @@ -1842,11 +1827,11 @@ class KeyedStruct eProsima_user_DllExport BasicStruct& basic(); /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -1902,6 +1887,7 @@ class KeyedStruct uint8_t m_key; BasicStruct m_basic; + }; #endif // _FAST_DDS_GENERATED_TEST_H_ \ No newline at end of file diff --git a/test/unittest/dynamic_types/idl/TestTypeObject.cxx b/test/unittest/dynamic_types/idl/TestTypeObject.cxx index e94d575548f..7f405767862 100644 --- a/test/unittest/dynamic_types/idl/TestTypeObject.cxx +++ b/test/unittest/dynamic_types/idl/TestTypeObject.cxx @@ -2326,7 +2326,7 @@ const TypeObject* GetMinimalMySequenceLongObject() //type_object->minimal().alias_type().body().common().related_flags().IS_DEFAULT(false); // Must be defined already, if don't, may be an recursive alias - const TypeIdentifier *relatedType = TypeObjectFactory::get_instance()->get_type_identifier(TypeNamesGenerator::get_sequence_type_name("int32_t", 0), false); + const TypeIdentifier *relatedType = TypeObjectFactory::get_instance()->get_type_identifier(TypeNamesGenerator::get_sequence_type_name("int32_t", 100), false); if (relatedType != nullptr) @@ -2363,7 +2363,7 @@ const TypeObject* GetMinimalMySequenceLongObject() } // Don't add our TypeIdentifier but our alias - TypeObjectFactory::get_instance()->add_alias("MySequenceLong", TypeNamesGenerator::get_sequence_type_name("int32_t", 0)); + TypeObjectFactory::get_instance()->add_alias("MySequenceLong", TypeNamesGenerator::get_sequence_type_name("int32_t", 100)); TypeObjectFactory::get_instance()->add_type_object("MySequenceLong", &identifier, type_object); delete type_object; @@ -2408,7 +2408,7 @@ const TypeObject* GetCompleteMySequenceLongObject() //type_object->complete().alias_type().body().common().ann_custom() // Must be defined already, if don't, may be an recursive alias - const TypeIdentifier *relatedType = TypeObjectFactory::get_instance()->get_type_identifier_trying_complete(TypeNamesGenerator::get_sequence_type_name("int32_t", 0)); + const TypeIdentifier *relatedType = TypeObjectFactory::get_instance()->get_type_identifier_trying_complete(TypeNamesGenerator::get_sequence_type_name("int32_t", 100)); if (relatedType != nullptr) @@ -2445,7 +2445,7 @@ const TypeObject* GetCompleteMySequenceLongObject() } // Don't add our TypeIdentifier but our alias - TypeObjectFactory::get_instance()->add_alias("MySequenceLong", TypeNamesGenerator::get_sequence_type_name("int32_t", 0)); + TypeObjectFactory::get_instance()->add_alias("MySequenceLong", TypeNamesGenerator::get_sequence_type_name("int32_t", 100)); TypeObjectFactory::get_instance()->add_type_object("MySequenceLong", &identifier, type_object); delete type_object; @@ -2595,7 +2595,7 @@ const TypeObject* GetMinimalComplexStructObject() mst_my_sequence_struct.common().member_flags().IS_MUST_UNDERSTAND(false); mst_my_sequence_struct.common().member_flags().IS_KEY(false); mst_my_sequence_struct.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_sequence_struct.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("BasicStruct", 0, false)); + mst_my_sequence_struct.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("BasicStruct", 100, false)); MD5 my_sequence_struct_hash("my_sequence_struct"); @@ -2707,7 +2707,7 @@ const TypeObject* GetMinimalComplexStructObject() mst_my_map_long_seq_octet.common().member_flags().IS_MUST_UNDERSTAND(false); mst_my_map_long_seq_octet.common().member_flags().IS_KEY(false); mst_my_map_long_seq_octet.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_map_long_seq_octet.common().member_type_id(*TypeObjectFactory::get_instance()->get_map_identifier("int32_t", TypeNamesGenerator::get_sequence_type_name(TypeNamesGenerator::get_sequence_type_name("uint8_t", 0), 0), 100, false)); + mst_my_map_long_seq_octet.common().member_type_id(*TypeObjectFactory::get_instance()->get_map_identifier("int32_t", TypeNamesGenerator::get_sequence_type_name(TypeNamesGenerator::get_sequence_type_name("uint8_t", 100), 100), 100, false)); MD5 my_map_long_seq_octet_hash("my_map_long_seq_octet"); @@ -3039,7 +3039,7 @@ const TypeObject* GetCompleteComplexStructObject() cst_my_sequence_struct.common().member_flags().IS_MUST_UNDERSTAND(false); cst_my_sequence_struct.common().member_flags().IS_KEY(false); cst_my_sequence_struct.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_sequence_struct.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("BasicStruct", 0, true)); + cst_my_sequence_struct.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("BasicStruct", 100, true)); cst_my_sequence_struct.detail().name("my_sequence_struct"); @@ -3133,7 +3133,7 @@ const TypeObject* GetCompleteComplexStructObject() cst_my_map_long_seq_octet.common().member_flags().IS_MUST_UNDERSTAND(false); cst_my_map_long_seq_octet.common().member_flags().IS_KEY(false); cst_my_map_long_seq_octet.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_map_long_seq_octet.common().member_type_id(*TypeObjectFactory::get_instance()->get_map_identifier("int32_t", TypeNamesGenerator::get_sequence_type_name(TypeNamesGenerator::get_sequence_type_name("uint8_t", 0), 0), 100, true)); + cst_my_map_long_seq_octet.common().member_type_id(*TypeObjectFactory::get_instance()->get_map_identifier("int32_t", TypeNamesGenerator::get_sequence_type_name(TypeNamesGenerator::get_sequence_type_name("uint8_t", 100), 100), 100, true)); cst_my_map_long_seq_octet.detail().name("my_map_long_seq_octet"); diff --git a/test/unittest/dynamic_types/idl/new_features_4_2.cxx b/test/unittest/dynamic_types/idl/new_features_4_2.cxx index a1a92e6b674..9fabf419677 100644 --- a/test/unittest/dynamic_types/idl/new_features_4_2.cxx +++ b/test/unittest/dynamic_types/idl/new_features_4_2.cxx @@ -35,25 +35,46 @@ using namespace eprosima::fastcdr::exception; #include + + +#define bitmodule_BM2_max_cdr_typesize 24ULL; +#define NewAliases_max_cdr_typesize 32ULL; + +#define StructTest_max_cdr_typesize 80ULL; + + + +#define bitmodule_BitsetBitmask_max_cdr_typesize 17ULL; + + +#define bitmodule_BM2_max_key_cdr_typesize 0ULL; +#define NewAliases_max_key_cdr_typesize 0ULL; + +#define StructTest_max_key_cdr_typesize 0ULL; + + + +#define bitmodule_BitsetBitmask_max_key_cdr_typesize 0ULL; + NewAliases::NewAliases() { - // m_int8_ com.eprosima.idl.parser.typecode.PrimitiveTypeCode@1e7c7811 + // int8 m_int8_ m_int8_ = 0; - // m_uint8_ com.eprosima.idl.parser.typecode.PrimitiveTypeCode@77ec78b9 + // uint8 m_uint8_ m_uint8_ = 0; - // m_int16_ com.eprosima.idl.parser.typecode.PrimitiveTypeCode@1a3869f4 + // short m_int16_ m_int16_ = 0; - // m_uint16_ com.eprosima.idl.parser.typecode.PrimitiveTypeCode@a38d7a3 + // unsigned short m_uint16_ m_uint16_ = 0; - // m_int32_ com.eprosima.idl.parser.typecode.PrimitiveTypeCode@77f99a05 + // long m_int32_ m_int32_ = 0; - // m_uint32_ com.eprosima.idl.parser.typecode.PrimitiveTypeCode@63440df3 + // unsigned long m_uint32_ m_uint32_ = 0; - // m_int64_ com.eprosima.idl.parser.typecode.PrimitiveTypeCode@3aeaafa6 + // long long m_int64_ m_int64_ = 0; - // m_uint64_ com.eprosima.idl.parser.typecode.PrimitiveTypeCode@4d3167f4 + // unsigned long long m_uint64_ m_uint64_ = 555; - // m_local_string com.eprosima.idl.parser.typecode.StringTypeCode@6121c9d6 + // string m_local_string m_local_string =""; // Just to register all known types @@ -151,36 +172,8 @@ bool NewAliases::operator !=( size_t NewAliases::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); - - - current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - - current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - - - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return NewAliases_max_cdr_typesize; } size_t NewAliases::getCdrSerializedSize( @@ -512,23 +505,12 @@ std::string& NewAliases::local_string() return m_local_string; } + size_t NewAliases::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - - - - - - - - - - return current_align; + static_cast(current_alignment); + return NewAliases_max_key_cdr_typesize; } bool NewAliases::isKeyDefined() @@ -540,15 +522,14 @@ void NewAliases::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - } WCharUnion::WCharUnion() { m__d = 'a'; - // m_case_zero com.eprosima.idl.parser.typecode.PrimitiveTypeCode@8e24743 + // long m_case_zero m_case_zero = 0; - // m_case_one com.eprosima.idl.parser.typecode.PrimitiveTypeCode@74a10858 + // long m_case_one m_case_one = 0; } @@ -800,38 +781,6 @@ int32_t& WCharUnion::case_one() return m_case_one; } -size_t WCharUnion::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - size_t reset_alignment = 0; - size_t union_max_size_serialized = 0; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - reset_alignment = current_alignment; - - reset_alignment += 4 + eprosima::fastcdr::Cdr::alignment(reset_alignment, 4); - - - if(union_max_size_serialized < reset_alignment) - union_max_size_serialized = reset_alignment; - - - reset_alignment = current_alignment; - - reset_alignment += 4 + eprosima::fastcdr::Cdr::alignment(reset_alignment, 4); - - - if(union_max_size_serialized < reset_alignment) - union_max_size_serialized = reset_alignment; - - - - return union_max_size_serialized - initial_alignment; -} - // TODO(Ricardo) Review size_t WCharUnion::getCdrSerializedSize( const WCharUnion& data, @@ -901,9 +850,9 @@ void WCharUnion::deserialize( OctetUnion::OctetUnion() { m__d = 5; - // m_case_five com.eprosima.idl.parser.typecode.PrimitiveTypeCode@13eb8acf + // long m_case_five m_case_five = 0; - // m_case_seven com.eprosima.idl.parser.typecode.PrimitiveTypeCode@51c8530f + // long m_case_seven m_case_seven = 0; } @@ -1155,38 +1104,6 @@ int32_t& OctetUnion::case_seven() return m_case_seven; } -size_t OctetUnion::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - size_t reset_alignment = 0; - size_t union_max_size_serialized = 0; - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - reset_alignment = current_alignment; - - reset_alignment += 4 + eprosima::fastcdr::Cdr::alignment(reset_alignment, 4); - - - if(union_max_size_serialized < reset_alignment) - union_max_size_serialized = reset_alignment; - - - reset_alignment = current_alignment; - - reset_alignment += 4 + eprosima::fastcdr::Cdr::alignment(reset_alignment, 4); - - - if(union_max_size_serialized < reset_alignment) - union_max_size_serialized = reset_alignment; - - - - return union_max_size_serialized - initial_alignment; -} - // TODO(Ricardo) Review size_t OctetUnion::getCdrSerializedSize( const OctetUnion& data, @@ -1256,9 +1173,9 @@ void OctetUnion::deserialize( Int8Union::Int8Union() { m__d = 3; - // m_case_three com.eprosima.idl.parser.typecode.PrimitiveTypeCode@1fc2b765 + // long m_case_three m_case_three = 0; - // m_case_six com.eprosima.idl.parser.typecode.PrimitiveTypeCode@75881071 + // long m_case_six m_case_six = 0; } @@ -1510,38 +1427,6 @@ int32_t& Int8Union::case_six() return m_case_six; } -size_t Int8Union::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - size_t reset_alignment = 0; - size_t union_max_size_serialized = 0; - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - reset_alignment = current_alignment; - - reset_alignment += 4 + eprosima::fastcdr::Cdr::alignment(reset_alignment, 4); - - - if(union_max_size_serialized < reset_alignment) - union_max_size_serialized = reset_alignment; - - - reset_alignment = current_alignment; - - reset_alignment += 4 + eprosima::fastcdr::Cdr::alignment(reset_alignment, 4); - - - if(union_max_size_serialized < reset_alignment) - union_max_size_serialized = reset_alignment; - - - - return union_max_size_serialized - initial_alignment; -} - // TODO(Ricardo) Review size_t Int8Union::getCdrSerializedSize( const Int8Union& data, @@ -1661,18 +1546,6 @@ bool bitmodule::ParentBitset::operator !=( return !(*this == x); } -size_t bitmodule::ParentBitset::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - return current_alignment - initial_alignment; -} - size_t bitmodule::ParentBitset::getCdrSerializedSize( const bitmodule::ParentBitset& , size_t current_alignment) @@ -1782,36 +1655,6 @@ bool bitmodule::MyBitset::operator !=( return !(*this == x); } -size_t bitmodule::MyBitset::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - current_alignment += bitmodule::ParentBitset::getMaxCdrSerializedSize(current_alignment); - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - - current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); - - - current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); - - - current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); - - - current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); - - - - return current_alignment - initial_alignment; -} - size_t bitmodule::MyBitset::getCdrSerializedSize( const bitmodule::MyBitset& data, size_t current_alignment) @@ -2010,9 +1853,9 @@ int16_t bitmodule::MyBitset::f() const bitmodule::BitsetBitmask::BitsetBitmask() { - // m_mybitset com.eprosima.idl.parser.typecode.BitsetTypeCode@15bfd87 + // bitmodule::MyBitset m_mybitset - // m_mybitmask com.eprosima.idl.parser.typecode.BitmaskTypeCode@543e710e + // bitmodule::MyBitMask m_mybitmask m_mybitmask = static_cast(0); // Just to register all known types @@ -2075,15 +1918,8 @@ bool bitmodule::BitsetBitmask::operator !=( size_t bitmodule::BitsetBitmask::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += bitmodule::MyBitset::getMaxCdrSerializedSize(current_alignment); - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return bitmodule_BitsetBitmask_max_cdr_typesize; } size_t bitmodule::BitsetBitmask::getCdrSerializedSize( @@ -2191,16 +2027,12 @@ bitmodule::MyBitMask& bitmodule::BitsetBitmask::mybitmask() } + size_t bitmodule::BitsetBitmask::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - - - return current_align; + static_cast(current_alignment); + return bitmodule_BitsetBitmask_max_key_cdr_typesize; } bool bitmodule::BitsetBitmask::isKeyDefined() @@ -2212,14 +2044,13 @@ void bitmodule::BitsetBitmask::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - } bitmodule::BM2::BM2() : bitmodule::BitsetBitmask() { - // m_two com.eprosima.idl.parser.typecode.BitmaskTypeCode@543e710e + // bitmodule::MyBitMask m_two m_two = static_cast(0); - // m_mylong com.eprosima.idl.parser.typecode.PrimitiveTypeCode@27fe3806 + // long m_mylong m_mylong = 0; // Just to register all known types @@ -2285,18 +2116,8 @@ bool bitmodule::BM2::operator !=( size_t bitmodule::BM2::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - current_alignment += bitmodule::BitsetBitmask::getMaxCdrSerializedSize(current_alignment); - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return bitmodule_BM2_max_cdr_typesize; } size_t bitmodule::BM2::getCdrSerializedSize( @@ -2400,17 +2221,12 @@ int32_t& bitmodule::BM2::mylong() } + size_t bitmodule::BM2::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - current_align += bitmodule::BitsetBitmask::getKeyMaxCdrSerializedSize(current_align); - - - - - return current_align; + static_cast(current_alignment); + return bitmodule_BM2_max_key_cdr_typesize; } bool bitmodule::BM2::isKeyDefined() @@ -2424,20 +2240,19 @@ void bitmodule::BM2::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - bitmodule::BitsetBitmask::serializeKey(scdr); - + bitmodule::BitsetBitmask::serializeKey(scdr); } StructTest::StructTest() : NewAliases() { - // m_charUnion com.eprosima.idl.parser.typecode.UnionTypeCode@548a102f + // WCharUnion m_charUnion - // m_octetUnion com.eprosima.idl.parser.typecode.UnionTypeCode@5762806e + // OctetUnion m_octetUnion - // m_int8Union com.eprosima.idl.parser.typecode.UnionTypeCode@17c386de + // Int8Union m_int8Union - // m_myStructBits com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@5af97850 + // bitmodule::BM2 m_myStructBits // Just to register all known types @@ -2513,16 +2328,8 @@ bool StructTest::operator !=( size_t StructTest::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - current_alignment += NewAliases::getMaxCdrSerializedSize(current_alignment); - - current_alignment += WCharUnion::getMaxCdrSerializedSize(current_alignment); - current_alignment += OctetUnion::getMaxCdrSerializedSize(current_alignment); - current_alignment += Int8Union::getMaxCdrSerializedSize(current_alignment); - current_alignment += bitmodule::BM2::getMaxCdrSerializedSize(current_alignment); - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return StructTest_max_cdr_typesize; } size_t StructTest::getCdrSerializedSize( @@ -2714,19 +2521,12 @@ bitmodule::BM2& StructTest::myStructBits() return m_myStructBits; } + size_t StructTest::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - current_align += NewAliases::getKeyMaxCdrSerializedSize(current_align); - - - - - - - return current_align; + static_cast(current_alignment); + return StructTest_max_key_cdr_typesize; } bool StructTest::isKeyDefined() @@ -2740,6 +2540,5 @@ void StructTest::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - NewAliases::serializeKey(scdr); - + NewAliases::serializeKey(scdr); } diff --git a/test/unittest/dynamic_types/idl/new_features_4_2.h b/test/unittest/dynamic_types/idl/new_features_4_2.h index a5a35873170..d33db352639 100644 --- a/test/unittest/dynamic_types/idl/new_features_4_2.h +++ b/test/unittest/dynamic_types/idl/new_features_4_2.h @@ -302,11 +302,11 @@ class NewAliases eProsima_user_DllExport std::string& local_string(); /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -369,6 +369,7 @@ class NewAliases int64_t m_int64_; uint64_t m_uint64_; std::string m_local_string; + }; /*! * @brief This class represents the union WCharUnion defined by the user in the IDL file. @@ -493,15 +494,6 @@ class WCharUnion eProsima_user_DllExport int32_t& case_one(); - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - /*! * @brief This function returns the serialized size of a data depending on the buffer alignment. * @param data Data which is calculated its serialized size. @@ -660,15 +652,6 @@ class OctetUnion eProsima_user_DllExport int32_t& case_seven(); - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - /*! * @brief This function returns the serialized size of a data depending on the buffer alignment. * @param data Data which is calculated its serialized size. @@ -827,15 +810,6 @@ class Int8Union eProsima_user_DllExport int32_t& case_six(); - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - /*! * @brief This function returns the serialized size of a data depending on the buffer alignment. * @param data Data which is calculated its serialized size. @@ -945,15 +919,6 @@ namespace bitmodule { */ eProsima_user_DllExport uint32_t parent_bitfield() const; - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - /*! * @brief This function returns the serialized size of a data depending on the buffer alignment. * @param data Data which is calculated its serialized size. @@ -1120,15 +1085,6 @@ namespace bitmodule { */ eProsima_user_DllExport int16_t f() const; - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - /*! * @brief This function returns the serialized size of a data depending on the buffer alignment. * @param data Data which is calculated its serialized size. @@ -1279,11 +1235,11 @@ namespace bitmodule { /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -1339,6 +1295,7 @@ namespace bitmodule { bitmodule::MyBitset m_mybitset; bitmodule::MyBitMask m_mybitmask; + }; /*! * @brief This class represents the structure BM2 defined by the user in the IDL file. @@ -1440,11 +1397,11 @@ namespace bitmodule { /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -1500,6 +1457,7 @@ namespace bitmodule { bitmodule::MyBitMask m_two; int32_t m_mylong; + }; } // namespace bitmodule /*! @@ -1664,11 +1622,11 @@ class StructTest : public NewAliases eProsima_user_DllExport bitmodule::BM2& myStructBits(); /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -1726,6 +1684,7 @@ class StructTest : public NewAliases OctetUnion m_octetUnion; Int8Union m_int8Union; bitmodule::BM2 m_myStructBits; + }; #endif // _FAST_DDS_GENERATED_NEW_FEATURES_4_2_H_ \ No newline at end of file diff --git a/test/unittest/dynamic_types/idl/new_features_4_2PubSubTypes.h b/test/unittest/dynamic_types/idl/new_features_4_2PubSubTypes.h index 83c53bbebbc..b7fc792a631 100644 --- a/test/unittest/dynamic_types/idl/new_features_4_2PubSubTypes.h +++ b/test/unittest/dynamic_types/idl/new_features_4_2PubSubTypes.h @@ -143,7 +143,7 @@ namespace bitmodule #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED eProsima_user_DllExport inline bool is_bounded() const override { - return false; + return true; } #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED @@ -151,7 +151,7 @@ namespace bitmodule #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN eProsima_user_DllExport inline bool is_plain() const override { - return false; + return true; } #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN @@ -160,8 +160,8 @@ namespace bitmodule eProsima_user_DllExport inline bool construct_sample( void* memory) const override { - (void)memory; - return false; + new (memory) BitsetBitmask(); + return true; } #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE @@ -207,7 +207,7 @@ namespace bitmodule #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED eProsima_user_DllExport inline bool is_bounded() const override { - return false; + return true; } #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED @@ -215,7 +215,7 @@ namespace bitmodule #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN eProsima_user_DllExport inline bool is_plain() const override { - return false; + return true; } #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN @@ -224,8 +224,8 @@ namespace bitmodule eProsima_user_DllExport inline bool construct_sample( void* memory) const override { - (void)memory; - return false; + new (memory) BM2(); + return true; } #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE diff --git a/test/unittest/xtypes/idl/Types.cxx b/test/unittest/xtypes/idl/Types.cxx index c19e062d3c5..f98c6d86141 100644 --- a/test/unittest/xtypes/idl/Types.cxx +++ b/test/unittest/xtypes/idl/Types.cxx @@ -35,11 +35,100 @@ using namespace eprosima::fastcdr::exception; #include +#define SimpleUnionStruct_max_cdr_typesize 16ULL; +#define SequenceSequenceBoundsStruct_max_cdr_typesize 124ULL; + +#define MyAliasEnumStruct_max_cdr_typesize 4ULL; +#define ArrayBadStruct_max_cdr_typesize 3ULL; +#define MapBadKeyStruct_max_cdr_typesize 20ULL; +#define SimpleBadUnionStruct_max_cdr_typesize 16ULL; +#define MyEnumStruct_max_cdr_typesize 4ULL; + +#define ArrayStructEqual_max_cdr_typesize 12ULL; +#define LargeWStringStruct_max_cdr_typesize 167704ULL; + +#define WStringStruct_max_cdr_typesize 1024ULL; +#define SequenceStruct_max_cdr_typesize 12ULL; +#define SimpleTypeUnionStruct_max_cdr_typesize 16ULL; + +#define ArrayDimensionsStruct_max_cdr_typesize 20ULL; +#define SequenceSequenceStruct_max_cdr_typesize 40ULL; +#define MapBoundsStruct_max_cdr_typesize 36ULL; +#define SequenceStructEqual_max_cdr_typesize 12ULL; +#define MapStructEqual_max_cdr_typesize 20ULL; +#define BasicStruct_max_cdr_typesize 268ULL; +#define SequenceBoundsStruct_max_cdr_typesize 20ULL; +#define MapMapStruct_max_cdr_typesize 52ULL; +#define BasicWideStruct_max_cdr_typesize 532ULL; + +#define SimplBadDiscUnionStruct_max_cdr_typesize 16ULL; +#define MapStruct_max_cdr_typesize 20ULL; + +#define MyBadEnumStruct_max_cdr_typesize 4ULL; +#define SequenceBadStruct_max_cdr_typesize 6ULL; +#define SimpleUnionNamesStruct_max_cdr_typesize 16ULL; +#define LargeStringStruct_max_cdr_typesize 41930ULL; +#define ArrayStruct_max_cdr_typesize 12ULL; +#define BadBasicWideStruct_max_cdr_typesize 532ULL; +#define ArraySizeStruct_max_cdr_typesize 24ULL; + +#define MapBadElemStruct_max_cdr_typesize 32ULL; +#define SimpleUnionStructEqual_max_cdr_typesize 16ULL; +#define BasicBadStruct_max_cdr_typesize 268ULL; +#define BasicNamesStruct_max_cdr_typesize 268ULL; +#define StringStruct_max_cdr_typesize 260ULL; + +#define MapMapBoundsStruct_max_cdr_typesize 100ULL; +#define SimpleUnionStruct_max_key_cdr_typesize 0ULL; +#define SequenceSequenceBoundsStruct_max_key_cdr_typesize 0ULL; + +#define MyAliasEnumStruct_max_key_cdr_typesize 0ULL; +#define ArrayBadStruct_max_key_cdr_typesize 0ULL; +#define MapBadKeyStruct_max_key_cdr_typesize 0ULL; +#define SimpleBadUnionStruct_max_key_cdr_typesize 0ULL; +#define MyEnumStruct_max_key_cdr_typesize 0ULL; + +#define ArrayStructEqual_max_key_cdr_typesize 0ULL; +#define LargeWStringStruct_max_key_cdr_typesize 0ULL; + +#define WStringStruct_max_key_cdr_typesize 0ULL; +#define SequenceStruct_max_key_cdr_typesize 0ULL; +#define SimpleTypeUnionStruct_max_key_cdr_typesize 0ULL; + +#define ArrayDimensionsStruct_max_key_cdr_typesize 0ULL; +#define SequenceSequenceStruct_max_key_cdr_typesize 0ULL; +#define MapBoundsStruct_max_key_cdr_typesize 0ULL; +#define SequenceStructEqual_max_key_cdr_typesize 0ULL; +#define MapStructEqual_max_key_cdr_typesize 0ULL; +#define BasicStruct_max_key_cdr_typesize 0ULL; +#define SequenceBoundsStruct_max_key_cdr_typesize 0ULL; +#define MapMapStruct_max_key_cdr_typesize 0ULL; +#define BasicWideStruct_max_key_cdr_typesize 0ULL; + +#define SimplBadDiscUnionStruct_max_key_cdr_typesize 0ULL; +#define MapStruct_max_key_cdr_typesize 0ULL; + +#define MyBadEnumStruct_max_key_cdr_typesize 0ULL; +#define SequenceBadStruct_max_key_cdr_typesize 0ULL; +#define SimpleUnionNamesStruct_max_key_cdr_typesize 0ULL; +#define LargeStringStruct_max_key_cdr_typesize 0ULL; +#define ArrayStruct_max_key_cdr_typesize 0ULL; +#define BadBasicWideStruct_max_key_cdr_typesize 0ULL; +#define ArraySizeStruct_max_key_cdr_typesize 0ULL; + +#define MapBadElemStruct_max_key_cdr_typesize 0ULL; +#define SimpleUnionStructEqual_max_key_cdr_typesize 0ULL; +#define BasicBadStruct_max_key_cdr_typesize 0ULL; +#define BasicNamesStruct_max_key_cdr_typesize 0ULL; +#define StringStruct_max_key_cdr_typesize 0ULL; + +#define MapMapBoundsStruct_max_key_cdr_typesize 0ULL; + MyEnumStruct::MyEnumStruct() { - // m_my_enum com.eprosima.idl.parser.typecode.EnumTypeCode@631330c + // MyEnum m_my_enum m_my_enum = ::A; // Just to register all known types @@ -57,7 +146,7 @@ MyEnumStruct::MyEnumStruct( } MyEnumStruct::MyEnumStruct( - MyEnumStruct&& x) noexcept + MyEnumStruct&& x) noexcept { m_my_enum = x.m_my_enum; } @@ -96,13 +185,8 @@ bool MyEnumStruct::operator !=( size_t MyEnumStruct::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return MyEnumStruct_max_cdr_typesize; } size_t MyEnumStruct::getCdrSerializedSize( @@ -168,14 +252,12 @@ MyEnum& MyEnumStruct::my_enum() } + size_t MyEnumStruct::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - return current_align; + static_cast(current_alignment); + return MyEnumStruct_max_key_cdr_typesize; } bool MyEnumStruct::isKeyDefined() @@ -187,12 +269,11 @@ void MyEnumStruct::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - } MyBadEnumStruct::MyBadEnumStruct() { - // m_my_enum com.eprosima.idl.parser.typecode.EnumTypeCode@36b4cef0 + // MyBadEnum m_my_enum m_my_enum = ::A1; // Just to register all known types @@ -210,7 +291,7 @@ MyBadEnumStruct::MyBadEnumStruct( } MyBadEnumStruct::MyBadEnumStruct( - MyBadEnumStruct&& x) noexcept + MyBadEnumStruct&& x) noexcept { m_my_enum = x.m_my_enum; } @@ -249,13 +330,8 @@ bool MyBadEnumStruct::operator !=( size_t MyBadEnumStruct::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return MyBadEnumStruct_max_cdr_typesize; } size_t MyBadEnumStruct::getCdrSerializedSize( @@ -321,14 +397,12 @@ MyBadEnum& MyBadEnumStruct::my_enum() } + size_t MyBadEnumStruct::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - return current_align; + static_cast(current_alignment); + return MyBadEnumStruct_max_key_cdr_typesize; } bool MyBadEnumStruct::isKeyDefined() @@ -340,13 +414,12 @@ void MyBadEnumStruct::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - } MyAliasEnumStruct::MyAliasEnumStruct() { - // m_my_enum com.eprosima.idl.parser.typecode.AliasTypeCode@32d2fa64 + // MyAliasEnum m_my_enum m_my_enum = ::A; // Just to register all known types @@ -364,7 +437,7 @@ MyAliasEnumStruct::MyAliasEnumStruct( } MyAliasEnumStruct::MyAliasEnumStruct( - MyAliasEnumStruct&& x) noexcept + MyAliasEnumStruct&& x) noexcept { m_my_enum = x.m_my_enum; } @@ -403,13 +476,8 @@ bool MyAliasEnumStruct::operator !=( size_t MyAliasEnumStruct::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return MyAliasEnumStruct_max_cdr_typesize; } size_t MyAliasEnumStruct::getCdrSerializedSize( @@ -475,14 +543,12 @@ MyAliasEnum& MyAliasEnumStruct::my_enum() } + size_t MyAliasEnumStruct::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - return current_align; + static_cast(current_alignment); + return MyAliasEnumStruct_max_key_cdr_typesize; } bool MyAliasEnumStruct::isKeyDefined() @@ -494,16 +560,15 @@ void MyAliasEnumStruct::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - } BasicStruct::BasicStruct() { - // m_my_bool com.eprosima.idl.parser.typecode.PrimitiveTypeCode@371a67ec + // boolean m_my_bool m_my_bool = false; - // m_my_int32 com.eprosima.idl.parser.typecode.PrimitiveTypeCode@5ed828d + // long m_my_int32 m_my_int32 = 0; - // m_my_string com.eprosima.idl.parser.typecode.StringTypeCode@50d0686 + // string m_my_string m_my_string =""; // Just to register all known types @@ -526,7 +591,7 @@ BasicStruct::BasicStruct( } BasicStruct::BasicStruct( - BasicStruct&& x) noexcept + BasicStruct&& x) noexcept { m_my_bool = x.m_my_bool; m_my_int32 = x.m_my_int32; @@ -571,19 +636,8 @@ bool BasicStruct::operator !=( size_t BasicStruct::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + 255 + 1; - - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return BasicStruct_max_cdr_typesize; } size_t BasicStruct::getCdrSerializedSize( @@ -719,17 +773,12 @@ std::string& BasicStruct::my_string() return m_my_string; } + size_t BasicStruct::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - - - - return current_align; + static_cast(current_alignment); + return BasicStruct_max_key_cdr_typesize; } bool BasicStruct::isKeyDefined() @@ -741,16 +790,15 @@ void BasicStruct::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - } BasicNamesStruct::BasicNamesStruct() { - // m_my_bool_name com.eprosima.idl.parser.typecode.PrimitiveTypeCode@ed9d034 + // boolean m_my_bool_name m_my_bool_name = false; - // m_my_int32_name com.eprosima.idl.parser.typecode.PrimitiveTypeCode@6121c9d6 + // long m_my_int32_name m_my_int32_name = 0; - // m_my_string_name com.eprosima.idl.parser.typecode.StringTypeCode@87f383f + // string m_my_string_name m_my_string_name =""; // Just to register all known types @@ -773,7 +821,7 @@ BasicNamesStruct::BasicNamesStruct( } BasicNamesStruct::BasicNamesStruct( - BasicNamesStruct&& x) noexcept + BasicNamesStruct&& x) noexcept { m_my_bool_name = x.m_my_bool_name; m_my_int32_name = x.m_my_int32_name; @@ -818,19 +866,8 @@ bool BasicNamesStruct::operator !=( size_t BasicNamesStruct::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + 255 + 1; - - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return BasicNamesStruct_max_cdr_typesize; } size_t BasicNamesStruct::getCdrSerializedSize( @@ -966,17 +1003,12 @@ std::string& BasicNamesStruct::my_string_name() return m_my_string_name; } + size_t BasicNamesStruct::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - - - - return current_align; + static_cast(current_alignment); + return BasicNamesStruct_max_key_cdr_typesize; } bool BasicNamesStruct::isKeyDefined() @@ -988,16 +1020,15 @@ void BasicNamesStruct::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - } BasicBadStruct::BasicBadStruct() { - // m_my_bool com.eprosima.idl.parser.typecode.PrimitiveTypeCode@491cc5c9 + // octet m_my_bool m_my_bool = 0; - // m_my_int32 com.eprosima.idl.parser.typecode.PrimitiveTypeCode@74ad1f1f + // long m_my_int32 m_my_int32 = 0; - // m_my_string com.eprosima.idl.parser.typecode.StringTypeCode@6a1aab78 + // string m_my_string m_my_string =""; // Just to register all known types @@ -1020,7 +1051,7 @@ BasicBadStruct::BasicBadStruct( } BasicBadStruct::BasicBadStruct( - BasicBadStruct&& x) noexcept + BasicBadStruct&& x) noexcept { m_my_bool = x.m_my_bool; m_my_int32 = x.m_my_int32; @@ -1065,19 +1096,8 @@ bool BasicBadStruct::operator !=( size_t BasicBadStruct::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + 255 + 1; - - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return BasicBadStruct_max_cdr_typesize; } size_t BasicBadStruct::getCdrSerializedSize( @@ -1213,17 +1233,12 @@ std::string& BasicBadStruct::my_string() return m_my_string; } + size_t BasicBadStruct::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - - - - return current_align; + static_cast(current_alignment); + return BasicBadStruct_max_key_cdr_typesize; } bool BasicBadStruct::isKeyDefined() @@ -1235,20 +1250,19 @@ void BasicBadStruct::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - } BasicWideStruct::BasicWideStruct() { - // m_my_bool com.eprosima.idl.parser.typecode.PrimitiveTypeCode@8646db9 + // boolean m_my_bool m_my_bool = false; - // m_my_int32 com.eprosima.idl.parser.typecode.PrimitiveTypeCode@37374a5e + // long m_my_int32 m_my_int32 = 0; - // m_my_string com.eprosima.idl.parser.typecode.StringTypeCode@4671e53b + // string m_my_string m_my_string =""; - // m_new_int32 com.eprosima.idl.parser.typecode.PrimitiveTypeCode@6950e31 + // long m_new_int32 m_new_int32 = 0; - // m_new_string com.eprosima.idl.parser.typecode.StringTypeCode@42eca56e + // string m_new_string m_new_string =""; // Just to register all known types @@ -1275,7 +1289,7 @@ BasicWideStruct::BasicWideStruct( } BasicWideStruct::BasicWideStruct( - BasicWideStruct&& x) noexcept + BasicWideStruct&& x) noexcept { m_my_bool = x.m_my_bool; m_my_int32 = x.m_my_int32; @@ -1326,24 +1340,8 @@ bool BasicWideStruct::operator !=( size_t BasicWideStruct::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + 255 + 1; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + 255 + 1; - - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return BasicWideStruct_max_cdr_typesize; } size_t BasicWideStruct::getCdrSerializedSize( @@ -1553,19 +1551,12 @@ std::string& BasicWideStruct::new_string() return m_new_string; } + size_t BasicWideStruct::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - - - - - - return current_align; + static_cast(current_alignment); + return BasicWideStruct_max_key_cdr_typesize; } bool BasicWideStruct::isKeyDefined() @@ -1577,20 +1568,19 @@ void BasicWideStruct::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - } BadBasicWideStruct::BadBasicWideStruct() { - // m_new_int32 com.eprosima.idl.parser.typecode.PrimitiveTypeCode@553a3d88 + // long m_new_int32 m_new_int32 = 0; - // m_new_string com.eprosima.idl.parser.typecode.StringTypeCode@7a30d1e6 + // string m_new_string m_new_string =""; - // m_my_bool com.eprosima.idl.parser.typecode.PrimitiveTypeCode@5891e32e + // boolean m_my_bool m_my_bool = false; - // m_my_int32 com.eprosima.idl.parser.typecode.PrimitiveTypeCode@cb0ed20 + // long m_my_int32 m_my_int32 = 0; - // m_my_string com.eprosima.idl.parser.typecode.StringTypeCode@8e24743 + // string m_my_string m_my_string =""; // Just to register all known types @@ -1617,7 +1607,7 @@ BadBasicWideStruct::BadBasicWideStruct( } BadBasicWideStruct::BadBasicWideStruct( - BadBasicWideStruct&& x) noexcept + BadBasicWideStruct&& x) noexcept { m_new_int32 = x.m_new_int32; m_new_string = std::move(x.m_new_string); @@ -1668,24 +1658,8 @@ bool BadBasicWideStruct::operator !=( size_t BadBasicWideStruct::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + 255 + 1; - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + 255 + 1; - - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return BadBasicWideStruct_max_cdr_typesize; } size_t BadBasicWideStruct::getCdrSerializedSize( @@ -1895,19 +1869,12 @@ std::string& BadBasicWideStruct::my_string() return m_my_string; } + size_t BadBasicWideStruct::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - - - - - - return current_align; + static_cast(current_alignment); + return BadBasicWideStruct_max_key_cdr_typesize; } bool BadBasicWideStruct::isKeyDefined() @@ -1919,12 +1886,11 @@ void BadBasicWideStruct::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - } StringStruct::StringStruct() { - // m_my_string com.eprosima.idl.parser.typecode.StringTypeCode@13eb8acf + // string m_my_string m_my_string =""; // Just to register all known types @@ -1942,7 +1908,7 @@ StringStruct::StringStruct( } StringStruct::StringStruct( - StringStruct&& x) noexcept + StringStruct&& x) noexcept { m_my_string = std::move(x.m_my_string); } @@ -1981,12 +1947,8 @@ bool StringStruct::operator !=( size_t StringStruct::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + 255 + 1; - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return StringStruct_max_cdr_typesize; } size_t StringStruct::getCdrSerializedSize( @@ -2054,14 +2016,12 @@ std::string& StringStruct::my_string() return m_my_string; } + size_t StringStruct::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - return current_align; + static_cast(current_alignment); + return StringStruct_max_key_cdr_typesize; } bool StringStruct::isKeyDefined() @@ -2073,12 +2033,11 @@ void StringStruct::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - } LargeStringStruct::LargeStringStruct() { - // m_my_large_string com.eprosima.idl.parser.typecode.StringTypeCode@43738a82 + // string m_my_large_string m_my_large_string =""; // Just to register all known types @@ -2096,7 +2055,7 @@ LargeStringStruct::LargeStringStruct( } LargeStringStruct::LargeStringStruct( - LargeStringStruct&& x) noexcept + LargeStringStruct&& x) noexcept { m_my_large_string = std::move(x.m_my_large_string); } @@ -2135,12 +2094,8 @@ bool LargeStringStruct::operator !=( size_t LargeStringStruct::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + 41925 + 1; - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return LargeStringStruct_max_cdr_typesize; } size_t LargeStringStruct::getCdrSerializedSize( @@ -2212,14 +2167,12 @@ eprosima::fastrtps::fixed_string<41925>& LargeStringStruct::my_large_string() return m_my_large_string; } + size_t LargeStringStruct::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - return current_align; + static_cast(current_alignment); + return LargeStringStruct_max_key_cdr_typesize; } bool LargeStringStruct::isKeyDefined() @@ -2231,12 +2184,11 @@ void LargeStringStruct::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - } WStringStruct::WStringStruct() { - // m_my_wstring com.eprosima.idl.parser.typecode.StringTypeCode@75881071 + // wstring m_my_wstring // Just to register all known types @@ -2254,7 +2206,7 @@ WStringStruct::WStringStruct( } WStringStruct::WStringStruct( - WStringStruct&& x) noexcept + WStringStruct&& x) noexcept { m_my_wstring = std::move(x.m_my_wstring); } @@ -2293,12 +2245,8 @@ bool WStringStruct::operator !=( size_t WStringStruct::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + (255) * 4; // 32 bits - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return WStringStruct_max_cdr_typesize; } size_t WStringStruct::getCdrSerializedSize( @@ -2367,14 +2315,12 @@ std::wstring& WStringStruct::my_wstring() return m_my_wstring; } + size_t WStringStruct::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - return current_align; + static_cast(current_alignment); + return WStringStruct_max_key_cdr_typesize; } bool WStringStruct::isKeyDefined() @@ -2386,12 +2332,11 @@ void WStringStruct::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - } LargeWStringStruct::LargeWStringStruct() { - // m_my_large_wstring com.eprosima.idl.parser.typecode.StringTypeCode@2a70a3d8 + // wstring m_my_large_wstring // Just to register all known types @@ -2409,7 +2354,7 @@ LargeWStringStruct::LargeWStringStruct( } LargeWStringStruct::LargeWStringStruct( - LargeWStringStruct&& x) noexcept + LargeWStringStruct&& x) noexcept { m_my_large_wstring = std::move(x.m_my_large_wstring); } @@ -2448,12 +2393,8 @@ bool LargeWStringStruct::operator !=( size_t LargeWStringStruct::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + (41925) * 4; // 32 bits - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return LargeWStringStruct_max_cdr_typesize; } size_t LargeWStringStruct::getCdrSerializedSize( @@ -2522,14 +2463,12 @@ std::wstring& LargeWStringStruct::my_large_wstring() return m_my_large_wstring; } + size_t LargeWStringStruct::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - return current_align; + static_cast(current_alignment); + return LargeWStringStruct_max_key_cdr_typesize; } bool LargeWStringStruct::isKeyDefined() @@ -2541,12 +2480,11 @@ void LargeWStringStruct::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - } ArrayStruct::ArrayStruct() { - // m_my_array com.eprosima.idl.parser.typecode.ArrayTypeCode@3891771e + // long m_my_array memset(&m_my_array, 0, (2) * 4); // Just to register all known types @@ -2564,7 +2502,7 @@ ArrayStruct::ArrayStruct( } ArrayStruct::ArrayStruct( - ArrayStruct&& x) noexcept + ArrayStruct&& x) noexcept { m_my_array = std::move(x.m_my_array); } @@ -2603,13 +2541,8 @@ bool ArrayStruct::operator !=( size_t ArrayStruct::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += ((2) * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return ArrayStruct_max_cdr_typesize; } size_t ArrayStruct::getCdrSerializedSize( @@ -2680,14 +2613,12 @@ std::array& ArrayStruct::my_array() return m_my_array; } + size_t ArrayStruct::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - return current_align; + static_cast(current_alignment); + return ArrayStruct_max_key_cdr_typesize; } bool ArrayStruct::isKeyDefined() @@ -2699,12 +2630,11 @@ void ArrayStruct::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - } ArrayStructEqual::ArrayStructEqual() { - // m_my_array_equal com.eprosima.idl.parser.typecode.ArrayTypeCode@12c8a2c0 + // long m_my_array_equal memset(&m_my_array_equal, 0, (2) * 4); // Just to register all known types @@ -2722,7 +2652,7 @@ ArrayStructEqual::ArrayStructEqual( } ArrayStructEqual::ArrayStructEqual( - ArrayStructEqual&& x) noexcept + ArrayStructEqual&& x) noexcept { m_my_array_equal = std::move(x.m_my_array_equal); } @@ -2761,13 +2691,8 @@ bool ArrayStructEqual::operator !=( size_t ArrayStructEqual::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += ((2) * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return ArrayStructEqual_max_cdr_typesize; } size_t ArrayStructEqual::getCdrSerializedSize( @@ -2838,14 +2763,12 @@ std::array& ArrayStructEqual::my_array_equal() return m_my_array_equal; } + size_t ArrayStructEqual::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - return current_align; + static_cast(current_alignment); + return ArrayStructEqual_max_key_cdr_typesize; } bool ArrayStructEqual::isKeyDefined() @@ -2857,12 +2780,11 @@ void ArrayStructEqual::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - } ArrayBadStruct::ArrayBadStruct() { - // m_my_array com.eprosima.idl.parser.typecode.ArrayTypeCode@365185bd + // octet m_my_array memset(&m_my_array, 0, (2) * 1); // Just to register all known types @@ -2880,7 +2802,7 @@ ArrayBadStruct::ArrayBadStruct( } ArrayBadStruct::ArrayBadStruct( - ArrayBadStruct&& x) noexcept + ArrayBadStruct&& x) noexcept { m_my_array = std::move(x.m_my_array); } @@ -2919,13 +2841,8 @@ bool ArrayBadStruct::operator !=( size_t ArrayBadStruct::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += ((2) * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return ArrayBadStruct_max_cdr_typesize; } size_t ArrayBadStruct::getCdrSerializedSize( @@ -2996,14 +2913,12 @@ std::array& ArrayBadStruct::my_array() return m_my_array; } + size_t ArrayBadStruct::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - return current_align; + static_cast(current_alignment); + return ArrayBadStruct_max_key_cdr_typesize; } bool ArrayBadStruct::isKeyDefined() @@ -3015,12 +2930,11 @@ void ArrayBadStruct::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - } ArrayDimensionsStruct::ArrayDimensionsStruct() { - // m_my_array com.eprosima.idl.parser.typecode.ArrayTypeCode@42607a4f + // long m_my_array memset(&m_my_array, 0, (2 * 2) * 4); // Just to register all known types @@ -3038,7 +2952,7 @@ ArrayDimensionsStruct::ArrayDimensionsStruct( } ArrayDimensionsStruct::ArrayDimensionsStruct( - ArrayDimensionsStruct&& x) noexcept + ArrayDimensionsStruct&& x) noexcept { m_my_array = std::move(x.m_my_array); } @@ -3077,13 +2991,8 @@ bool ArrayDimensionsStruct::operator !=( size_t ArrayDimensionsStruct::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += ((2 * 2) * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return ArrayDimensionsStruct_max_cdr_typesize; } size_t ArrayDimensionsStruct::getCdrSerializedSize( @@ -3154,14 +3063,12 @@ std::array, 2>& ArrayDimensionsStruct::my_array() return m_my_array; } + size_t ArrayDimensionsStruct::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - return current_align; + static_cast(current_alignment); + return ArrayDimensionsStruct_max_key_cdr_typesize; } bool ArrayDimensionsStruct::isKeyDefined() @@ -3173,12 +3080,11 @@ void ArrayDimensionsStruct::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - } ArraySizeStruct::ArraySizeStruct() { - // m_my_array com.eprosima.idl.parser.typecode.ArrayTypeCode@7276c8cd + // long m_my_array memset(&m_my_array, 0, (5) * 4); // Just to register all known types @@ -3196,7 +3102,7 @@ ArraySizeStruct::ArraySizeStruct( } ArraySizeStruct::ArraySizeStruct( - ArraySizeStruct&& x) noexcept + ArraySizeStruct&& x) noexcept { m_my_array = std::move(x.m_my_array); } @@ -3235,13 +3141,8 @@ bool ArraySizeStruct::operator !=( size_t ArraySizeStruct::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += ((5) * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return ArraySizeStruct_max_cdr_typesize; } size_t ArraySizeStruct::getCdrSerializedSize( @@ -3312,14 +3213,12 @@ std::array& ArraySizeStruct::my_array() return m_my_array; } + size_t ArraySizeStruct::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - return current_align; + static_cast(current_alignment); + return ArraySizeStruct_max_key_cdr_typesize; } bool ArraySizeStruct::isKeyDefined() @@ -3331,12 +3230,11 @@ void ArraySizeStruct::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - } SequenceStruct::SequenceStruct() { - // m_my_sequence com.eprosima.idl.parser.typecode.SequenceTypeCode@3b94d659 + // sequence m_my_sequence // Just to register all known types @@ -3354,7 +3252,7 @@ SequenceStruct::SequenceStruct( } SequenceStruct::SequenceStruct( - SequenceStruct&& x) noexcept + SequenceStruct&& x) noexcept { m_my_sequence = std::move(x.m_my_sequence); } @@ -3393,16 +3291,8 @@ bool SequenceStruct::operator !=( size_t SequenceStruct::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - current_alignment += (2 * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return SequenceStruct_max_cdr_typesize; } size_t SequenceStruct::getCdrSerializedSize( @@ -3476,14 +3366,12 @@ std::vector& SequenceStruct::my_sequence() return m_my_sequence; } + size_t SequenceStruct::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - return current_align; + static_cast(current_alignment); + return SequenceStruct_max_key_cdr_typesize; } bool SequenceStruct::isKeyDefined() @@ -3495,12 +3383,11 @@ void SequenceStruct::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - } SequenceStructEqual::SequenceStructEqual() { - // m_my_sequence_equal com.eprosima.idl.parser.typecode.SequenceTypeCode@24b1d79b + // sequence m_my_sequence_equal // Just to register all known types @@ -3518,7 +3405,7 @@ SequenceStructEqual::SequenceStructEqual( } SequenceStructEqual::SequenceStructEqual( - SequenceStructEqual&& x) noexcept + SequenceStructEqual&& x) noexcept { m_my_sequence_equal = std::move(x.m_my_sequence_equal); } @@ -3557,16 +3444,8 @@ bool SequenceStructEqual::operator !=( size_t SequenceStructEqual::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - current_alignment += (2 * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return SequenceStructEqual_max_cdr_typesize; } size_t SequenceStructEqual::getCdrSerializedSize( @@ -3640,14 +3519,12 @@ std::vector& SequenceStructEqual::my_sequence_equal() return m_my_sequence_equal; } + size_t SequenceStructEqual::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - return current_align; + static_cast(current_alignment); + return SequenceStructEqual_max_key_cdr_typesize; } bool SequenceStructEqual::isKeyDefined() @@ -3659,12 +3536,11 @@ void SequenceStructEqual::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - } SequenceBadStruct::SequenceBadStruct() { - // m_my_sequence com.eprosima.idl.parser.typecode.SequenceTypeCode@281e3708 + // sequence m_my_sequence // Just to register all known types @@ -3682,7 +3558,7 @@ SequenceBadStruct::SequenceBadStruct( } SequenceBadStruct::SequenceBadStruct( - SequenceBadStruct&& x) noexcept + SequenceBadStruct&& x) noexcept { m_my_sequence = std::move(x.m_my_sequence); } @@ -3721,16 +3597,8 @@ bool SequenceBadStruct::operator !=( size_t SequenceBadStruct::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - current_alignment += (2 * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return SequenceBadStruct_max_cdr_typesize; } size_t SequenceBadStruct::getCdrSerializedSize( @@ -3804,14 +3672,12 @@ std::vector& SequenceBadStruct::my_sequence() return m_my_sequence; } + size_t SequenceBadStruct::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - return current_align; + static_cast(current_alignment); + return SequenceBadStruct_max_key_cdr_typesize; } bool SequenceBadStruct::isKeyDefined() @@ -3823,12 +3689,11 @@ void SequenceBadStruct::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - } SequenceBoundsStruct::SequenceBoundsStruct() { - // m_my_sequence com.eprosima.idl.parser.typecode.SequenceTypeCode@103f852 + // sequence m_my_sequence // Just to register all known types @@ -3846,7 +3711,7 @@ SequenceBoundsStruct::SequenceBoundsStruct( } SequenceBoundsStruct::SequenceBoundsStruct( - SequenceBoundsStruct&& x) noexcept + SequenceBoundsStruct&& x) noexcept { m_my_sequence = std::move(x.m_my_sequence); } @@ -3885,16 +3750,8 @@ bool SequenceBoundsStruct::operator !=( size_t SequenceBoundsStruct::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - current_alignment += (4 * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return SequenceBoundsStruct_max_cdr_typesize; } size_t SequenceBoundsStruct::getCdrSerializedSize( @@ -3968,14 +3825,12 @@ std::vector& SequenceBoundsStruct::my_sequence() return m_my_sequence; } + size_t SequenceBoundsStruct::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - return current_align; + static_cast(current_alignment); + return SequenceBoundsStruct_max_key_cdr_typesize; } bool SequenceBoundsStruct::isKeyDefined() @@ -3987,12 +3842,11 @@ void SequenceBoundsStruct::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - } SequenceSequenceStruct::SequenceSequenceStruct() { - // m_my_sequence_sequence com.eprosima.idl.parser.typecode.SequenceTypeCode@77a57272 + // sequence, 3> m_my_sequence_sequence // Just to register all known types @@ -4010,7 +3864,7 @@ SequenceSequenceStruct::SequenceSequenceStruct( } SequenceSequenceStruct::SequenceSequenceStruct( - SequenceSequenceStruct&& x) noexcept + SequenceSequenceStruct&& x) noexcept { m_my_sequence_sequence = std::move(x.m_my_sequence_sequence); } @@ -4049,22 +3903,8 @@ bool SequenceSequenceStruct::operator !=( size_t SequenceSequenceStruct::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - for(size_t a = 0; a < 3; ++a) - { - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - current_alignment += (2 * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - } - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return SequenceSequenceStruct_max_cdr_typesize; } size_t SequenceSequenceStruct::getCdrSerializedSize( @@ -4144,14 +3984,12 @@ std::vector>& SequenceSequenceStruct::my_sequence_sequence( return m_my_sequence_sequence; } + size_t SequenceSequenceStruct::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - return current_align; + static_cast(current_alignment); + return SequenceSequenceStruct_max_key_cdr_typesize; } bool SequenceSequenceStruct::isKeyDefined() @@ -4163,12 +4001,11 @@ void SequenceSequenceStruct::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - } SequenceSequenceBoundsStruct::SequenceSequenceBoundsStruct() { - // m_my_sequence_sequence com.eprosima.idl.parser.typecode.SequenceTypeCode@6e2c9341 + // sequence, 5> m_my_sequence_sequence // Just to register all known types @@ -4186,7 +4023,7 @@ SequenceSequenceBoundsStruct::SequenceSequenceBoundsStruct( } SequenceSequenceBoundsStruct::SequenceSequenceBoundsStruct( - SequenceSequenceBoundsStruct&& x) noexcept + SequenceSequenceBoundsStruct&& x) noexcept { m_my_sequence_sequence = std::move(x.m_my_sequence_sequence); } @@ -4225,22 +4062,8 @@ bool SequenceSequenceBoundsStruct::operator !=( size_t SequenceSequenceBoundsStruct::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - for(size_t a = 0; a < 5; ++a) - { - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - current_alignment += (5 * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - } - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return SequenceSequenceBoundsStruct_max_cdr_typesize; } size_t SequenceSequenceBoundsStruct::getCdrSerializedSize( @@ -4320,14 +4143,12 @@ std::vector>& SequenceSequenceBoundsStruct::my_sequence_seq return m_my_sequence_sequence; } + size_t SequenceSequenceBoundsStruct::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - return current_align; + static_cast(current_alignment); + return SequenceSequenceBoundsStruct_max_key_cdr_typesize; } bool SequenceSequenceBoundsStruct::isKeyDefined() @@ -4339,12 +4160,11 @@ void SequenceSequenceBoundsStruct::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - } MapStruct::MapStruct() { - // m_my_map com.eprosima.idl.parser.typecode.MapTypeCode@4e4aea35 + // map m_my_map // Just to register all known types @@ -4362,7 +4182,7 @@ MapStruct::MapStruct( } MapStruct::MapStruct( - MapStruct&& x) noexcept + MapStruct&& x) noexcept { m_my_map = std::move(x.m_my_map); } @@ -4401,23 +4221,8 @@ bool MapStruct::operator !=( size_t MapStruct::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - for(size_t a = 0; a < 2; ++a) - { - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - } - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return MapStruct_max_cdr_typesize; } size_t MapStruct::getCdrSerializedSize( @@ -4494,14 +4299,12 @@ std::map& MapStruct::my_map() return m_my_map; } + size_t MapStruct::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - return current_align; + static_cast(current_alignment); + return MapStruct_max_key_cdr_typesize; } bool MapStruct::isKeyDefined() @@ -4513,12 +4316,11 @@ void MapStruct::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - } MapStructEqual::MapStructEqual() { - // m_my_map_equal com.eprosima.idl.parser.typecode.MapTypeCode@1442d7b5 + // map m_my_map_equal // Just to register all known types @@ -4536,7 +4338,7 @@ MapStructEqual::MapStructEqual( } MapStructEqual::MapStructEqual( - MapStructEqual&& x) noexcept + MapStructEqual&& x) noexcept { m_my_map_equal = std::move(x.m_my_map_equal); } @@ -4575,23 +4377,8 @@ bool MapStructEqual::operator !=( size_t MapStructEqual::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - for(size_t a = 0; a < 2; ++a) - { - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - } - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return MapStructEqual_max_cdr_typesize; } size_t MapStructEqual::getCdrSerializedSize( @@ -4668,14 +4455,12 @@ std::map& MapStructEqual::my_map_equal() return m_my_map_equal; } + size_t MapStructEqual::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - return current_align; + static_cast(current_alignment); + return MapStructEqual_max_key_cdr_typesize; } bool MapStructEqual::isKeyDefined() @@ -4687,12 +4472,11 @@ void MapStructEqual::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - } MapBadKeyStruct::MapBadKeyStruct() { - // m_my_map com.eprosima.idl.parser.typecode.MapTypeCode@1ee807c6 + // map m_my_map // Just to register all known types @@ -4710,7 +4494,7 @@ MapBadKeyStruct::MapBadKeyStruct( } MapBadKeyStruct::MapBadKeyStruct( - MapBadKeyStruct&& x) noexcept + MapBadKeyStruct&& x) noexcept { m_my_map = std::move(x.m_my_map); } @@ -4749,23 +4533,8 @@ bool MapBadKeyStruct::operator !=( size_t MapBadKeyStruct::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - for(size_t a = 0; a < 2; ++a) - { - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - } - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return MapBadKeyStruct_max_cdr_typesize; } size_t MapBadKeyStruct::getCdrSerializedSize( @@ -4842,14 +4611,12 @@ std::map& MapBadKeyStruct::my_map() return m_my_map; } + size_t MapBadKeyStruct::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - return current_align; + static_cast(current_alignment); + return MapBadKeyStruct_max_key_cdr_typesize; } bool MapBadKeyStruct::isKeyDefined() @@ -4861,12 +4628,11 @@ void MapBadKeyStruct::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - } MapBadElemStruct::MapBadElemStruct() { - // m_my_map com.eprosima.idl.parser.typecode.MapTypeCode@76a4d6c + // map m_my_map // Just to register all known types @@ -4884,7 +4650,7 @@ MapBadElemStruct::MapBadElemStruct( } MapBadElemStruct::MapBadElemStruct( - MapBadElemStruct&& x) noexcept + MapBadElemStruct&& x) noexcept { m_my_map = std::move(x.m_my_map); } @@ -4920,26 +4686,11 @@ bool MapBadElemStruct::operator !=( return !(*this == x); } -size_t MapBadElemStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - for(size_t a = 0; a < 2; ++a) - { - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - - current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - - } - - return current_alignment - initial_alignment; +size_t MapBadElemStruct::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return MapBadElemStruct_max_cdr_typesize; } size_t MapBadElemStruct::getCdrSerializedSize( @@ -5016,14 +4767,12 @@ std::map& MapBadElemStruct::my_map() return m_my_map; } + size_t MapBadElemStruct::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - return current_align; + static_cast(current_alignment); + return MapBadElemStruct_max_key_cdr_typesize; } bool MapBadElemStruct::isKeyDefined() @@ -5035,12 +4784,11 @@ void MapBadElemStruct::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - } MapBoundsStruct::MapBoundsStruct() { - // m_my_map com.eprosima.idl.parser.typecode.MapTypeCode@679b62af + // map m_my_map // Just to register all known types @@ -5058,7 +4806,7 @@ MapBoundsStruct::MapBoundsStruct( } MapBoundsStruct::MapBoundsStruct( - MapBoundsStruct&& x) noexcept + MapBoundsStruct&& x) noexcept { m_my_map = std::move(x.m_my_map); } @@ -5097,23 +4845,8 @@ bool MapBoundsStruct::operator !=( size_t MapBoundsStruct::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - for(size_t a = 0; a < 4; ++a) - { - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - } - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return MapBoundsStruct_max_cdr_typesize; } size_t MapBoundsStruct::getCdrSerializedSize( @@ -5190,14 +4923,12 @@ std::map& MapBoundsStruct::my_map() return m_my_map; } + size_t MapBoundsStruct::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - return current_align; + static_cast(current_alignment); + return MapBoundsStruct_max_key_cdr_typesize; } bool MapBoundsStruct::isKeyDefined() @@ -5209,12 +4940,11 @@ void MapBoundsStruct::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - } MapMapStruct::MapMapStruct() { - // m_my_map_map com.eprosima.idl.parser.typecode.MapTypeCode@d6da883 + // map> m_my_map_map // Just to register all known types @@ -5232,7 +4962,7 @@ MapMapStruct::MapMapStruct( } MapMapStruct::MapMapStruct( - MapMapStruct&& x) noexcept + MapMapStruct&& x) noexcept { m_my_map_map = std::move(x.m_my_map_map); } @@ -5271,32 +5001,8 @@ bool MapMapStruct::operator !=( size_t MapMapStruct::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - for(size_t a = 0; a < 2; ++a) - { - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - for(size_t b = 0; b < 2; ++b) - { - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - } - } - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return MapMapStruct_max_cdr_typesize; } size_t MapMapStruct::getCdrSerializedSize( @@ -5382,14 +5088,12 @@ std::map>& MapMapStruct::my_map_map() return m_my_map_map; } + size_t MapMapStruct::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - return current_align; + static_cast(current_alignment); + return MapMapStruct_max_key_cdr_typesize; } bool MapMapStruct::isKeyDefined() @@ -5401,12 +5105,11 @@ void MapMapStruct::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - } MapMapBoundsStruct::MapMapBoundsStruct() { - // m_my_map_map com.eprosima.idl.parser.typecode.MapTypeCode@799d4f69 + // map> m_my_map_map // Just to register all known types @@ -5424,7 +5127,7 @@ MapMapBoundsStruct::MapMapBoundsStruct( } MapMapBoundsStruct::MapMapBoundsStruct( - MapMapBoundsStruct&& x) noexcept + MapMapBoundsStruct&& x) noexcept { m_my_map_map = std::move(x.m_my_map_map); } @@ -5463,32 +5166,8 @@ bool MapMapBoundsStruct::operator !=( size_t MapMapBoundsStruct::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - for(size_t a = 0; a < 3; ++a) - { - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - for(size_t b = 0; b < 3; ++b) - { - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - } - } - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return MapMapBoundsStruct_max_cdr_typesize; } size_t MapMapBoundsStruct::getCdrSerializedSize( @@ -5574,14 +5253,12 @@ std::map>& MapMapBoundsStruct::my_map_map() return m_my_map_map; } + size_t MapMapBoundsStruct::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - return current_align; + static_cast(current_alignment); + return MapMapBoundsStruct_max_key_cdr_typesize; } bool MapMapBoundsStruct::isKeyDefined() @@ -5593,15 +5270,14 @@ void MapMapBoundsStruct::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - } SimpleUnion::SimpleUnion() { m__d = A; - // m_first com.eprosima.idl.parser.typecode.PrimitiveTypeCode@701fc37a + // long m_first m_first = 0; - // m_second com.eprosima.idl.parser.typecode.PrimitiveTypeCode@4148db48 + // long long m_second m_second = 0; } @@ -5853,38 +5529,6 @@ int64_t& SimpleUnion::second() return m_second; } -size_t SimpleUnion::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - size_t reset_alignment = 0; - size_t union_max_size_serialized = 0; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - reset_alignment = current_alignment; - - reset_alignment += 4 + eprosima::fastcdr::Cdr::alignment(reset_alignment, 4); - - - if(union_max_size_serialized < reset_alignment) - union_max_size_serialized = reset_alignment; - - - reset_alignment = current_alignment; - - reset_alignment += 8 + eprosima::fastcdr::Cdr::alignment(reset_alignment, 8); - - - if(union_max_size_serialized < reset_alignment) - union_max_size_serialized = reset_alignment; - - - - return union_max_size_serialized - initial_alignment; -} - // TODO(Ricardo) Review size_t SimpleUnion::getCdrSerializedSize( const SimpleUnion& data, @@ -5954,9 +5598,9 @@ void SimpleUnion::deserialize( SimpleUnionNames::SimpleUnionNames() { m__d = A; - // m_first_case com.eprosima.idl.parser.typecode.PrimitiveTypeCode@76329302 + // long m_first_case m_first_case = 0; - // m_second_case com.eprosima.idl.parser.typecode.PrimitiveTypeCode@5e25a92e + // long long m_second_case m_second_case = 0; } @@ -6208,38 +5852,6 @@ int64_t& SimpleUnionNames::second_case() return m_second_case; } -size_t SimpleUnionNames::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - size_t reset_alignment = 0; - size_t union_max_size_serialized = 0; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - reset_alignment = current_alignment; - - reset_alignment += 4 + eprosima::fastcdr::Cdr::alignment(reset_alignment, 4); - - - if(union_max_size_serialized < reset_alignment) - union_max_size_serialized = reset_alignment; - - - reset_alignment = current_alignment; - - reset_alignment += 8 + eprosima::fastcdr::Cdr::alignment(reset_alignment, 8); - - - if(union_max_size_serialized < reset_alignment) - union_max_size_serialized = reset_alignment; - - - - return union_max_size_serialized - initial_alignment; -} - // TODO(Ricardo) Review size_t SimpleUnionNames::getCdrSerializedSize( const SimpleUnionNames& data, @@ -6309,9 +5921,9 @@ void SimpleUnionNames::deserialize( SimpleTypeUnion::SimpleTypeUnion() { m__d = A; - // m_first com.eprosima.idl.parser.typecode.PrimitiveTypeCode@11e21d0e + // octet m_first m_first = 0; - // m_second com.eprosima.idl.parser.typecode.PrimitiveTypeCode@1dd02175 + // long long m_second m_second = 0; } @@ -6563,38 +6175,6 @@ int64_t& SimpleTypeUnion::second() return m_second; } -size_t SimpleTypeUnion::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - size_t reset_alignment = 0; - size_t union_max_size_serialized = 0; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - reset_alignment = current_alignment; - - reset_alignment += 1 + eprosima::fastcdr::Cdr::alignment(reset_alignment, 1); - - - if(union_max_size_serialized < reset_alignment) - union_max_size_serialized = reset_alignment; - - - reset_alignment = current_alignment; - - reset_alignment += 8 + eprosima::fastcdr::Cdr::alignment(reset_alignment, 8); - - - if(union_max_size_serialized < reset_alignment) - union_max_size_serialized = reset_alignment; - - - - return union_max_size_serialized - initial_alignment; -} - // TODO(Ricardo) Review size_t SimpleTypeUnion::getCdrSerializedSize( const SimpleTypeUnion& data, @@ -6664,9 +6244,9 @@ void SimpleTypeUnion::deserialize( SimpleBadUnion::SimpleBadUnion() { m__d = A; - // m_first com.eprosima.idl.parser.typecode.PrimitiveTypeCode@31206beb + // long m_first m_first = 0; - // m_second com.eprosima.idl.parser.typecode.PrimitiveTypeCode@3e77a1ed + // long long m_second m_second = 0; } @@ -6918,38 +6498,6 @@ int64_t& SimpleBadUnion::second() return m_second; } -size_t SimpleBadUnion::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - size_t reset_alignment = 0; - size_t union_max_size_serialized = 0; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - reset_alignment = current_alignment; - - reset_alignment += 4 + eprosima::fastcdr::Cdr::alignment(reset_alignment, 4); - - - if(union_max_size_serialized < reset_alignment) - union_max_size_serialized = reset_alignment; - - - reset_alignment = current_alignment; - - reset_alignment += 8 + eprosima::fastcdr::Cdr::alignment(reset_alignment, 8); - - - if(union_max_size_serialized < reset_alignment) - union_max_size_serialized = reset_alignment; - - - - return union_max_size_serialized - initial_alignment; -} - // TODO(Ricardo) Review size_t SimpleBadUnion::getCdrSerializedSize( const SimpleBadUnion& data, @@ -7019,9 +6567,9 @@ void SimpleBadUnion::deserialize( SimpleBadDiscUnion::SimpleBadDiscUnion() { m__d = 0; - // m_first com.eprosima.idl.parser.typecode.PrimitiveTypeCode@23bb8443 + // long m_first m_first = 0; - // m_second com.eprosima.idl.parser.typecode.PrimitiveTypeCode@1176dcec + // long long m_second m_second = 0; } @@ -7273,38 +6821,6 @@ int64_t& SimpleBadDiscUnion::second() return m_second; } -size_t SimpleBadDiscUnion::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - size_t reset_alignment = 0; - size_t union_max_size_serialized = 0; - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - reset_alignment = current_alignment; - - reset_alignment += 4 + eprosima::fastcdr::Cdr::alignment(reset_alignment, 4); - - - if(union_max_size_serialized < reset_alignment) - union_max_size_serialized = reset_alignment; - - - reset_alignment = current_alignment; - - reset_alignment += 8 + eprosima::fastcdr::Cdr::alignment(reset_alignment, 8); - - - if(union_max_size_serialized < reset_alignment) - union_max_size_serialized = reset_alignment; - - - - return union_max_size_serialized - initial_alignment; -} - // TODO(Ricardo) Review size_t SimpleBadDiscUnion::getCdrSerializedSize( const SimpleBadDiscUnion& data, @@ -7373,7 +6889,7 @@ void SimpleBadDiscUnion::deserialize( SimpleUnionStruct::SimpleUnionStruct() { - // m_my_union com.eprosima.idl.parser.typecode.UnionTypeCode@120d6fe6 + // SimpleUnion m_my_union // Just to register all known types @@ -7391,7 +6907,7 @@ SimpleUnionStruct::SimpleUnionStruct( } SimpleUnionStruct::SimpleUnionStruct( - SimpleUnionStruct&& x) noexcept + SimpleUnionStruct&& x) noexcept { m_my_union = std::move(x.m_my_union); } @@ -7430,12 +6946,8 @@ bool SimpleUnionStruct::operator !=( size_t SimpleUnionStruct::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += SimpleUnion::getMaxCdrSerializedSize(current_alignment); - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return SimpleUnionStruct_max_cdr_typesize; } size_t SimpleUnionStruct::getCdrSerializedSize( @@ -7504,14 +7016,12 @@ SimpleUnion& SimpleUnionStruct::my_union() return m_my_union; } + size_t SimpleUnionStruct::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - return current_align; + static_cast(current_alignment); + return SimpleUnionStruct_max_key_cdr_typesize; } bool SimpleUnionStruct::isKeyDefined() @@ -7523,12 +7033,11 @@ void SimpleUnionStruct::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - } SimpleUnionStructEqual::SimpleUnionStructEqual() { - // m_my_union_equal com.eprosima.idl.parser.typecode.UnionTypeCode@120d6fe6 + // SimpleUnion m_my_union_equal // Just to register all known types @@ -7546,7 +7055,7 @@ SimpleUnionStructEqual::SimpleUnionStructEqual( } SimpleUnionStructEqual::SimpleUnionStructEqual( - SimpleUnionStructEqual&& x) noexcept + SimpleUnionStructEqual&& x) noexcept { m_my_union_equal = std::move(x.m_my_union_equal); } @@ -7585,12 +7094,8 @@ bool SimpleUnionStructEqual::operator !=( size_t SimpleUnionStructEqual::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += SimpleUnion::getMaxCdrSerializedSize(current_alignment); - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return SimpleUnionStructEqual_max_cdr_typesize; } size_t SimpleUnionStructEqual::getCdrSerializedSize( @@ -7659,14 +7164,12 @@ SimpleUnion& SimpleUnionStructEqual::my_union_equal() return m_my_union_equal; } + size_t SimpleUnionStructEqual::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - return current_align; + static_cast(current_alignment); + return SimpleUnionStructEqual_max_key_cdr_typesize; } bool SimpleUnionStructEqual::isKeyDefined() @@ -7678,12 +7181,11 @@ void SimpleUnionStructEqual::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - } SimpleUnionNamesStruct::SimpleUnionNamesStruct() { - // m_my_union com.eprosima.idl.parser.typecode.UnionTypeCode@3444d69d + // SimpleUnionNames m_my_union // Just to register all known types @@ -7701,7 +7203,7 @@ SimpleUnionNamesStruct::SimpleUnionNamesStruct( } SimpleUnionNamesStruct::SimpleUnionNamesStruct( - SimpleUnionNamesStruct&& x) noexcept + SimpleUnionNamesStruct&& x) noexcept { m_my_union = std::move(x.m_my_union); } @@ -7740,12 +7242,8 @@ bool SimpleUnionNamesStruct::operator !=( size_t SimpleUnionNamesStruct::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += SimpleUnionNames::getMaxCdrSerializedSize(current_alignment); - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return SimpleUnionNamesStruct_max_cdr_typesize; } size_t SimpleUnionNamesStruct::getCdrSerializedSize( @@ -7814,14 +7312,12 @@ SimpleUnionNames& SimpleUnionNamesStruct::my_union() return m_my_union; } + size_t SimpleUnionNamesStruct::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - return current_align; + static_cast(current_alignment); + return SimpleUnionNamesStruct_max_key_cdr_typesize; } bool SimpleUnionNamesStruct::isKeyDefined() @@ -7833,12 +7329,11 @@ void SimpleUnionNamesStruct::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - } SimpleTypeUnionStruct::SimpleTypeUnionStruct() { - // m_my_union com.eprosima.idl.parser.typecode.UnionTypeCode@1372ed45 + // SimpleTypeUnion m_my_union // Just to register all known types @@ -7856,7 +7351,7 @@ SimpleTypeUnionStruct::SimpleTypeUnionStruct( } SimpleTypeUnionStruct::SimpleTypeUnionStruct( - SimpleTypeUnionStruct&& x) noexcept + SimpleTypeUnionStruct&& x) noexcept { m_my_union = std::move(x.m_my_union); } @@ -7895,12 +7390,8 @@ bool SimpleTypeUnionStruct::operator !=( size_t SimpleTypeUnionStruct::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += SimpleTypeUnion::getMaxCdrSerializedSize(current_alignment); - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return SimpleTypeUnionStruct_max_cdr_typesize; } size_t SimpleTypeUnionStruct::getCdrSerializedSize( @@ -7969,14 +7460,12 @@ SimpleTypeUnion& SimpleTypeUnionStruct::my_union() return m_my_union; } + size_t SimpleTypeUnionStruct::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - return current_align; + static_cast(current_alignment); + return SimpleTypeUnionStruct_max_key_cdr_typesize; } bool SimpleTypeUnionStruct::isKeyDefined() @@ -7988,12 +7477,11 @@ void SimpleTypeUnionStruct::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - } SimpleBadUnionStruct::SimpleBadUnionStruct() { - // m_my_union com.eprosima.idl.parser.typecode.UnionTypeCode@6a79c292 + // SimpleBadUnion m_my_union // Just to register all known types @@ -8011,7 +7499,7 @@ SimpleBadUnionStruct::SimpleBadUnionStruct( } SimpleBadUnionStruct::SimpleBadUnionStruct( - SimpleBadUnionStruct&& x) noexcept + SimpleBadUnionStruct&& x) noexcept { m_my_union = std::move(x.m_my_union); } @@ -8050,12 +7538,8 @@ bool SimpleBadUnionStruct::operator !=( size_t SimpleBadUnionStruct::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += SimpleBadUnion::getMaxCdrSerializedSize(current_alignment); - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return SimpleBadUnionStruct_max_cdr_typesize; } size_t SimpleBadUnionStruct::getCdrSerializedSize( @@ -8124,14 +7608,12 @@ SimpleBadUnion& SimpleBadUnionStruct::my_union() return m_my_union; } + size_t SimpleBadUnionStruct::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - return current_align; + static_cast(current_alignment); + return SimpleBadUnionStruct_max_key_cdr_typesize; } bool SimpleBadUnionStruct::isKeyDefined() @@ -8143,12 +7625,11 @@ void SimpleBadUnionStruct::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - } SimplBadDiscUnionStruct::SimplBadDiscUnionStruct() { - // m_my_union com.eprosima.idl.parser.typecode.UnionTypeCode@25359ed8 + // SimpleBadDiscUnion m_my_union // Just to register all known types @@ -8166,7 +7647,7 @@ SimplBadDiscUnionStruct::SimplBadDiscUnionStruct( } SimplBadDiscUnionStruct::SimplBadDiscUnionStruct( - SimplBadDiscUnionStruct&& x) noexcept + SimplBadDiscUnionStruct&& x) noexcept { m_my_union = std::move(x.m_my_union); } @@ -8205,12 +7686,8 @@ bool SimplBadDiscUnionStruct::operator !=( size_t SimplBadDiscUnionStruct::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += SimpleBadDiscUnion::getMaxCdrSerializedSize(current_alignment); - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return SimplBadDiscUnionStruct_max_cdr_typesize; } size_t SimplBadDiscUnionStruct::getCdrSerializedSize( @@ -8279,14 +7756,12 @@ SimpleBadDiscUnion& SimplBadDiscUnionStruct::my_union() return m_my_union; } + size_t SimplBadDiscUnionStruct::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - return current_align; + static_cast(current_alignment); + return SimplBadDiscUnionStruct_max_key_cdr_typesize; } bool SimplBadDiscUnionStruct::isKeyDefined() @@ -8298,5 +7773,4 @@ void SimplBadDiscUnionStruct::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - } diff --git a/test/unittest/xtypes/idl/Types.h b/test/unittest/xtypes/idl/Types.h index 317ff658531..ff20ad14cb7 100644 --- a/test/unittest/xtypes/idl/Types.h +++ b/test/unittest/xtypes/idl/Types.h @@ -164,11 +164,11 @@ class MyEnumStruct /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -223,6 +223,7 @@ class MyEnumStruct private: MyEnum m_my_enum; + }; /*! * @brief This class represents the structure MyBadEnumStruct defined by the user in the IDL file. @@ -305,11 +306,11 @@ class MyBadEnumStruct /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -364,6 +365,7 @@ class MyBadEnumStruct private: MyBadEnum m_my_enum; + }; typedef MyEnum MyAliasEnum; /*! @@ -447,11 +449,11 @@ class MyAliasEnumStruct /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -506,6 +508,7 @@ class MyAliasEnumStruct private: MyAliasEnum m_my_enum; + }; /*! * @brief This class represents the structure BasicStruct defined by the user in the IDL file. @@ -632,11 +635,11 @@ class BasicStruct eProsima_user_DllExport std::string& my_string(); /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -693,6 +696,7 @@ class BasicStruct bool m_my_bool; int32_t m_my_int32; std::string m_my_string; + }; /*! * @brief This class represents the structure BasicNamesStruct defined by the user in the IDL file. @@ -819,11 +823,11 @@ class BasicNamesStruct eProsima_user_DllExport std::string& my_string_name(); /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -880,6 +884,7 @@ class BasicNamesStruct bool m_my_bool_name; int32_t m_my_int32_name; std::string m_my_string_name; + }; /*! * @brief This class represents the structure BasicBadStruct defined by the user in the IDL file. @@ -1006,11 +1011,11 @@ class BasicBadStruct eProsima_user_DllExport std::string& my_string(); /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -1067,6 +1072,7 @@ class BasicBadStruct uint8_t m_my_bool; int32_t m_my_int32; std::string m_my_string; + }; /*! * @brief This class represents the structure BasicWideStruct defined by the user in the IDL file. @@ -1237,11 +1243,11 @@ class BasicWideStruct eProsima_user_DllExport std::string& new_string(); /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -1300,6 +1306,7 @@ class BasicWideStruct std::string m_my_string; int32_t m_new_int32; std::string m_new_string; + }; /*! * @brief This class represents the structure BadBasicWideStruct defined by the user in the IDL file. @@ -1470,11 +1477,11 @@ class BadBasicWideStruct eProsima_user_DllExport std::string& my_string(); /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -1533,6 +1540,7 @@ class BadBasicWideStruct bool m_my_bool; int32_t m_my_int32; std::string m_my_string; + }; /*! * @brief This class represents the structure StringStruct defined by the user in the IDL file. @@ -1621,11 +1629,11 @@ class StringStruct eProsima_user_DllExport std::string& my_string(); /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -1680,6 +1688,7 @@ class StringStruct private: std::string m_my_string; + }; /*! * @brief This class represents the structure LargeStringStruct defined by the user in the IDL file. @@ -1768,11 +1777,11 @@ class LargeStringStruct eProsima_user_DllExport eprosima::fastrtps::fixed_string<41925>& my_large_string(); /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -1827,6 +1836,7 @@ class LargeStringStruct private: eprosima::fastrtps::fixed_string<41925> m_my_large_string; + }; /*! * @brief This class represents the structure WStringStruct defined by the user in the IDL file. @@ -1915,11 +1925,11 @@ class WStringStruct eProsima_user_DllExport std::wstring& my_wstring(); /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -1974,6 +1984,7 @@ class WStringStruct private: std::wstring m_my_wstring; + }; /*! * @brief This class represents the structure LargeWStringStruct defined by the user in the IDL file. @@ -2062,11 +2073,11 @@ class LargeWStringStruct eProsima_user_DllExport std::wstring& my_large_wstring(); /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -2121,6 +2132,7 @@ class LargeWStringStruct private: std::wstring m_my_large_wstring; + }; /*! * @brief This class represents the structure ArrayStruct defined by the user in the IDL file. @@ -2209,11 +2221,11 @@ class ArrayStruct eProsima_user_DllExport std::array& my_array(); /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -2268,6 +2280,7 @@ class ArrayStruct private: std::array m_my_array; + }; /*! * @brief This class represents the structure ArrayStructEqual defined by the user in the IDL file. @@ -2356,11 +2369,11 @@ class ArrayStructEqual eProsima_user_DllExport std::array& my_array_equal(); /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -2415,6 +2428,7 @@ class ArrayStructEqual private: std::array m_my_array_equal; + }; /*! * @brief This class represents the structure ArrayBadStruct defined by the user in the IDL file. @@ -2503,11 +2517,11 @@ class ArrayBadStruct eProsima_user_DllExport std::array& my_array(); /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -2562,6 +2576,7 @@ class ArrayBadStruct private: std::array m_my_array; + }; /*! * @brief This class represents the structure ArrayDimensionsStruct defined by the user in the IDL file. @@ -2650,11 +2665,11 @@ class ArrayDimensionsStruct eProsima_user_DllExport std::array, 2>& my_array(); /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -2709,6 +2724,7 @@ class ArrayDimensionsStruct private: std::array, 2> m_my_array; + }; /*! * @brief This class represents the structure ArraySizeStruct defined by the user in the IDL file. @@ -2797,11 +2813,11 @@ class ArraySizeStruct eProsima_user_DllExport std::array& my_array(); /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -2856,6 +2872,7 @@ class ArraySizeStruct private: std::array m_my_array; + }; /*! * @brief This class represents the structure SequenceStruct defined by the user in the IDL file. @@ -2944,11 +2961,11 @@ class SequenceStruct eProsima_user_DllExport std::vector& my_sequence(); /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -3003,6 +3020,7 @@ class SequenceStruct private: std::vector m_my_sequence; + }; /*! * @brief This class represents the structure SequenceStructEqual defined by the user in the IDL file. @@ -3091,11 +3109,11 @@ class SequenceStructEqual eProsima_user_DllExport std::vector& my_sequence_equal(); /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -3150,6 +3168,7 @@ class SequenceStructEqual private: std::vector m_my_sequence_equal; + }; /*! * @brief This class represents the structure SequenceBadStruct defined by the user in the IDL file. @@ -3238,11 +3257,11 @@ class SequenceBadStruct eProsima_user_DllExport std::vector& my_sequence(); /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -3297,6 +3316,7 @@ class SequenceBadStruct private: std::vector m_my_sequence; + }; /*! * @brief This class represents the structure SequenceBoundsStruct defined by the user in the IDL file. @@ -3385,11 +3405,11 @@ class SequenceBoundsStruct eProsima_user_DllExport std::vector& my_sequence(); /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -3444,6 +3464,7 @@ class SequenceBoundsStruct private: std::vector m_my_sequence; + }; /*! * @brief This class represents the structure SequenceSequenceStruct defined by the user in the IDL file. @@ -3532,11 +3553,11 @@ class SequenceSequenceStruct eProsima_user_DllExport std::vector>& my_sequence_sequence(); /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -3591,6 +3612,7 @@ class SequenceSequenceStruct private: std::vector> m_my_sequence_sequence; + }; /*! * @brief This class represents the structure SequenceSequenceBoundsStruct defined by the user in the IDL file. @@ -3679,11 +3701,11 @@ class SequenceSequenceBoundsStruct eProsima_user_DllExport std::vector>& my_sequence_sequence(); /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -3738,6 +3760,7 @@ class SequenceSequenceBoundsStruct private: std::vector> m_my_sequence_sequence; + }; /*! * @brief This class represents the structure MapStruct defined by the user in the IDL file. @@ -3826,11 +3849,11 @@ class MapStruct eProsima_user_DllExport std::map& my_map(); /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -3885,6 +3908,7 @@ class MapStruct private: std::map m_my_map; + }; /*! * @brief This class represents the structure MapStructEqual defined by the user in the IDL file. @@ -3973,11 +3997,11 @@ class MapStructEqual eProsima_user_DllExport std::map& my_map_equal(); /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -4032,6 +4056,7 @@ class MapStructEqual private: std::map m_my_map_equal; + }; /*! * @brief This class represents the structure MapBadKeyStruct defined by the user in the IDL file. @@ -4120,11 +4145,11 @@ class MapBadKeyStruct eProsima_user_DllExport std::map& my_map(); /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -4179,6 +4204,7 @@ class MapBadKeyStruct private: std::map m_my_map; + }; /*! * @brief This class represents the structure MapBadElemStruct defined by the user in the IDL file. @@ -4267,11 +4293,11 @@ class MapBadElemStruct eProsima_user_DllExport std::map& my_map(); /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -4326,6 +4352,7 @@ class MapBadElemStruct private: std::map m_my_map; + }; /*! * @brief This class represents the structure MapBoundsStruct defined by the user in the IDL file. @@ -4414,11 +4441,11 @@ class MapBoundsStruct eProsima_user_DllExport std::map& my_map(); /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -4473,6 +4500,7 @@ class MapBoundsStruct private: std::map m_my_map; + }; /*! * @brief This class represents the structure MapMapStruct defined by the user in the IDL file. @@ -4561,11 +4589,11 @@ class MapMapStruct eProsima_user_DllExport std::map>& my_map_map(); /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -4620,6 +4648,7 @@ class MapMapStruct private: std::map> m_my_map_map; + }; /*! * @brief This class represents the structure MapMapBoundsStruct defined by the user in the IDL file. @@ -4708,11 +4737,11 @@ class MapMapBoundsStruct eProsima_user_DllExport std::map>& my_map_map(); /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -4767,6 +4796,7 @@ class MapMapBoundsStruct private: std::map> m_my_map_map; + }; /*! * @brief This class represents the union SimpleUnion defined by the user in the IDL file. @@ -4891,15 +4921,6 @@ class SimpleUnion eProsima_user_DllExport int64_t& second(); - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - /*! * @brief This function returns the serialized size of a data depending on the buffer alignment. * @param data Data which is calculated its serialized size. @@ -5058,15 +5079,6 @@ class SimpleUnionNames eProsima_user_DllExport int64_t& second_case(); - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - /*! * @brief This function returns the serialized size of a data depending on the buffer alignment. * @param data Data which is calculated its serialized size. @@ -5225,15 +5237,6 @@ class SimpleTypeUnion eProsima_user_DllExport int64_t& second(); - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - /*! * @brief This function returns the serialized size of a data depending on the buffer alignment. * @param data Data which is calculated its serialized size. @@ -5392,15 +5395,6 @@ class SimpleBadUnion eProsima_user_DllExport int64_t& second(); - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - /*! * @brief This function returns the serialized size of a data depending on the buffer alignment. * @param data Data which is calculated its serialized size. @@ -5559,15 +5553,6 @@ class SimpleBadDiscUnion eProsima_user_DllExport int64_t& second(); - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - /*! * @brief This function returns the serialized size of a data depending on the buffer alignment. * @param data Data which is calculated its serialized size. @@ -5690,11 +5675,11 @@ class SimpleUnionStruct eProsima_user_DllExport SimpleUnion& my_union(); /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -5749,6 +5734,7 @@ class SimpleUnionStruct private: SimpleUnion m_my_union; + }; /*! * @brief This class represents the structure SimpleUnionStructEqual defined by the user in the IDL file. @@ -5837,11 +5823,11 @@ class SimpleUnionStructEqual eProsima_user_DllExport SimpleUnion& my_union_equal(); /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -5896,6 +5882,7 @@ class SimpleUnionStructEqual private: SimpleUnion m_my_union_equal; + }; /*! * @brief This class represents the structure SimpleUnionNamesStruct defined by the user in the IDL file. @@ -5984,11 +5971,11 @@ class SimpleUnionNamesStruct eProsima_user_DllExport SimpleUnionNames& my_union(); /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -6043,6 +6030,7 @@ class SimpleUnionNamesStruct private: SimpleUnionNames m_my_union; + }; /*! * @brief This class represents the structure SimpleTypeUnionStruct defined by the user in the IDL file. @@ -6131,11 +6119,11 @@ class SimpleTypeUnionStruct eProsima_user_DllExport SimpleTypeUnion& my_union(); /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -6190,6 +6178,7 @@ class SimpleTypeUnionStruct private: SimpleTypeUnion m_my_union; + }; /*! * @brief This class represents the structure SimpleBadUnionStruct defined by the user in the IDL file. @@ -6278,11 +6267,11 @@ class SimpleBadUnionStruct eProsima_user_DllExport SimpleBadUnion& my_union(); /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -6337,6 +6326,7 @@ class SimpleBadUnionStruct private: SimpleBadUnion m_my_union; + }; /*! * @brief This class represents the structure SimplBadDiscUnionStruct defined by the user in the IDL file. @@ -6425,11 +6415,11 @@ class SimplBadDiscUnionStruct eProsima_user_DllExport SimpleBadDiscUnion& my_union(); /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -6484,6 +6474,7 @@ class SimplBadDiscUnionStruct private: SimpleBadDiscUnion m_my_union; + }; #endif // _FAST_DDS_GENERATED_TYPES_H_ \ No newline at end of file diff --git a/test/unittest/xtypes/idl/WideEnum.cxx b/test/unittest/xtypes/idl/WideEnum.cxx index 8fcf9ca787f..436ae3182d5 100644 --- a/test/unittest/xtypes/idl/WideEnum.cxx +++ b/test/unittest/xtypes/idl/WideEnum.cxx @@ -35,10 +35,19 @@ using namespace eprosima::fastcdr::exception; #include +#define MyEnumWideStruct_max_cdr_typesize 4ULL; + +#define SimpleWideUnionStruct_max_cdr_typesize 16ULL; + +#define MyEnumWideStruct_max_key_cdr_typesize 0ULL; + +#define SimpleWideUnionStruct_max_key_cdr_typesize 0ULL; + + MyEnumWideStruct::MyEnumWideStruct() { - // m_my_enum_wide com.eprosima.idl.parser.typecode.EnumTypeCode@631330c + // MyEnumWide m_my_enum_wide m_my_enum_wide = ::A; // Just to register all known types @@ -95,13 +104,8 @@ bool MyEnumWideStruct::operator !=( size_t MyEnumWideStruct::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return MyEnumWideStruct_max_cdr_typesize; } size_t MyEnumWideStruct::getCdrSerializedSize( @@ -167,14 +171,12 @@ MyEnumWide& MyEnumWideStruct::my_enum_wide() } + size_t MyEnumWideStruct::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - return current_align; + static_cast(current_alignment); + return MyEnumWideStruct_max_key_cdr_typesize; } bool MyEnumWideStruct::isKeyDefined() @@ -186,17 +188,16 @@ void MyEnumWideStruct::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - } SimpleWideUnion::SimpleWideUnion() { m__d = A; - // m_first com.eprosima.idl.parser.typecode.PrimitiveTypeCode@7a3d45bd + // long m_first m_first = 0; - // m_second com.eprosima.idl.parser.typecode.PrimitiveTypeCode@1e7c7811 + // long long m_second m_second = 0; - // m_third com.eprosima.idl.parser.typecode.PrimitiveTypeCode@77ec78b9 + // octet m_third m_third = 0; } @@ -519,47 +520,6 @@ uint8_t& SimpleWideUnion::third() return m_third; } -size_t SimpleWideUnion::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - size_t reset_alignment = 0; - size_t union_max_size_serialized = 0; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - reset_alignment = current_alignment; - - reset_alignment += 4 + eprosima::fastcdr::Cdr::alignment(reset_alignment, 4); - - - if(union_max_size_serialized < reset_alignment) - union_max_size_serialized = reset_alignment; - - - reset_alignment = current_alignment; - - reset_alignment += 8 + eprosima::fastcdr::Cdr::alignment(reset_alignment, 8); - - - if(union_max_size_serialized < reset_alignment) - union_max_size_serialized = reset_alignment; - - - reset_alignment = current_alignment; - - reset_alignment += 1 + eprosima::fastcdr::Cdr::alignment(reset_alignment, 1); - - - if(union_max_size_serialized < reset_alignment) - union_max_size_serialized = reset_alignment; - - - - return union_max_size_serialized - initial_alignment; -} - // TODO(Ricardo) Review size_t SimpleWideUnion::getCdrSerializedSize( const SimpleWideUnion& data, @@ -639,7 +599,7 @@ void SimpleWideUnion::deserialize( SimpleWideUnionStruct::SimpleWideUnionStruct() { - // m_my_union com.eprosima.idl.parser.typecode.UnionTypeCode@4d3167f4 + // SimpleWideUnion m_my_union // Just to register all known types @@ -696,12 +656,8 @@ bool SimpleWideUnionStruct::operator !=( size_t SimpleWideUnionStruct::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += SimpleWideUnion::getMaxCdrSerializedSize(current_alignment); - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return SimpleWideUnionStruct_max_cdr_typesize; } size_t SimpleWideUnionStruct::getCdrSerializedSize( @@ -770,14 +726,12 @@ SimpleWideUnion& SimpleWideUnionStruct::my_union() return m_my_union; } + size_t SimpleWideUnionStruct::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - return current_align; + static_cast(current_alignment); + return SimpleWideUnionStruct_max_key_cdr_typesize; } bool SimpleWideUnionStruct::isKeyDefined() @@ -789,5 +743,4 @@ void SimpleWideUnionStruct::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - } diff --git a/test/unittest/xtypes/idl/WideEnum.h b/test/unittest/xtypes/idl/WideEnum.h index d9c6dc8d333..a826aa0f385 100644 --- a/test/unittest/xtypes/idl/WideEnum.h +++ b/test/unittest/xtypes/idl/WideEnum.h @@ -155,11 +155,11 @@ class MyEnumWideStruct /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -214,6 +214,7 @@ class MyEnumWideStruct private: MyEnumWide m_my_enum_wide; + }; /*! * @brief This class represents the union SimpleWideUnion defined by the user in the IDL file. @@ -359,15 +360,6 @@ class SimpleWideUnion eProsima_user_DllExport uint8_t& third(); - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - /*! * @brief This function returns the serialized size of a data depending on the buffer alignment. * @param data Data which is calculated its serialized size. @@ -491,11 +483,11 @@ class SimpleWideUnionStruct eProsima_user_DllExport SimpleWideUnion& my_union(); /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -550,6 +542,7 @@ class SimpleWideUnionStruct private: SimpleWideUnion m_my_union; + }; #endif // _FAST_DDS_GENERATED_WIDEENUM_H_ \ No newline at end of file diff --git a/test/xtypes/idl/Types.cxx b/test/xtypes/idl/Types.cxx index c19e062d3c5..f98c6d86141 100644 --- a/test/xtypes/idl/Types.cxx +++ b/test/xtypes/idl/Types.cxx @@ -35,11 +35,100 @@ using namespace eprosima::fastcdr::exception; #include +#define SimpleUnionStruct_max_cdr_typesize 16ULL; +#define SequenceSequenceBoundsStruct_max_cdr_typesize 124ULL; + +#define MyAliasEnumStruct_max_cdr_typesize 4ULL; +#define ArrayBadStruct_max_cdr_typesize 3ULL; +#define MapBadKeyStruct_max_cdr_typesize 20ULL; +#define SimpleBadUnionStruct_max_cdr_typesize 16ULL; +#define MyEnumStruct_max_cdr_typesize 4ULL; + +#define ArrayStructEqual_max_cdr_typesize 12ULL; +#define LargeWStringStruct_max_cdr_typesize 167704ULL; + +#define WStringStruct_max_cdr_typesize 1024ULL; +#define SequenceStruct_max_cdr_typesize 12ULL; +#define SimpleTypeUnionStruct_max_cdr_typesize 16ULL; + +#define ArrayDimensionsStruct_max_cdr_typesize 20ULL; +#define SequenceSequenceStruct_max_cdr_typesize 40ULL; +#define MapBoundsStruct_max_cdr_typesize 36ULL; +#define SequenceStructEqual_max_cdr_typesize 12ULL; +#define MapStructEqual_max_cdr_typesize 20ULL; +#define BasicStruct_max_cdr_typesize 268ULL; +#define SequenceBoundsStruct_max_cdr_typesize 20ULL; +#define MapMapStruct_max_cdr_typesize 52ULL; +#define BasicWideStruct_max_cdr_typesize 532ULL; + +#define SimplBadDiscUnionStruct_max_cdr_typesize 16ULL; +#define MapStruct_max_cdr_typesize 20ULL; + +#define MyBadEnumStruct_max_cdr_typesize 4ULL; +#define SequenceBadStruct_max_cdr_typesize 6ULL; +#define SimpleUnionNamesStruct_max_cdr_typesize 16ULL; +#define LargeStringStruct_max_cdr_typesize 41930ULL; +#define ArrayStruct_max_cdr_typesize 12ULL; +#define BadBasicWideStruct_max_cdr_typesize 532ULL; +#define ArraySizeStruct_max_cdr_typesize 24ULL; + +#define MapBadElemStruct_max_cdr_typesize 32ULL; +#define SimpleUnionStructEqual_max_cdr_typesize 16ULL; +#define BasicBadStruct_max_cdr_typesize 268ULL; +#define BasicNamesStruct_max_cdr_typesize 268ULL; +#define StringStruct_max_cdr_typesize 260ULL; + +#define MapMapBoundsStruct_max_cdr_typesize 100ULL; +#define SimpleUnionStruct_max_key_cdr_typesize 0ULL; +#define SequenceSequenceBoundsStruct_max_key_cdr_typesize 0ULL; + +#define MyAliasEnumStruct_max_key_cdr_typesize 0ULL; +#define ArrayBadStruct_max_key_cdr_typesize 0ULL; +#define MapBadKeyStruct_max_key_cdr_typesize 0ULL; +#define SimpleBadUnionStruct_max_key_cdr_typesize 0ULL; +#define MyEnumStruct_max_key_cdr_typesize 0ULL; + +#define ArrayStructEqual_max_key_cdr_typesize 0ULL; +#define LargeWStringStruct_max_key_cdr_typesize 0ULL; + +#define WStringStruct_max_key_cdr_typesize 0ULL; +#define SequenceStruct_max_key_cdr_typesize 0ULL; +#define SimpleTypeUnionStruct_max_key_cdr_typesize 0ULL; + +#define ArrayDimensionsStruct_max_key_cdr_typesize 0ULL; +#define SequenceSequenceStruct_max_key_cdr_typesize 0ULL; +#define MapBoundsStruct_max_key_cdr_typesize 0ULL; +#define SequenceStructEqual_max_key_cdr_typesize 0ULL; +#define MapStructEqual_max_key_cdr_typesize 0ULL; +#define BasicStruct_max_key_cdr_typesize 0ULL; +#define SequenceBoundsStruct_max_key_cdr_typesize 0ULL; +#define MapMapStruct_max_key_cdr_typesize 0ULL; +#define BasicWideStruct_max_key_cdr_typesize 0ULL; + +#define SimplBadDiscUnionStruct_max_key_cdr_typesize 0ULL; +#define MapStruct_max_key_cdr_typesize 0ULL; + +#define MyBadEnumStruct_max_key_cdr_typesize 0ULL; +#define SequenceBadStruct_max_key_cdr_typesize 0ULL; +#define SimpleUnionNamesStruct_max_key_cdr_typesize 0ULL; +#define LargeStringStruct_max_key_cdr_typesize 0ULL; +#define ArrayStruct_max_key_cdr_typesize 0ULL; +#define BadBasicWideStruct_max_key_cdr_typesize 0ULL; +#define ArraySizeStruct_max_key_cdr_typesize 0ULL; + +#define MapBadElemStruct_max_key_cdr_typesize 0ULL; +#define SimpleUnionStructEqual_max_key_cdr_typesize 0ULL; +#define BasicBadStruct_max_key_cdr_typesize 0ULL; +#define BasicNamesStruct_max_key_cdr_typesize 0ULL; +#define StringStruct_max_key_cdr_typesize 0ULL; + +#define MapMapBoundsStruct_max_key_cdr_typesize 0ULL; + MyEnumStruct::MyEnumStruct() { - // m_my_enum com.eprosima.idl.parser.typecode.EnumTypeCode@631330c + // MyEnum m_my_enum m_my_enum = ::A; // Just to register all known types @@ -57,7 +146,7 @@ MyEnumStruct::MyEnumStruct( } MyEnumStruct::MyEnumStruct( - MyEnumStruct&& x) noexcept + MyEnumStruct&& x) noexcept { m_my_enum = x.m_my_enum; } @@ -96,13 +185,8 @@ bool MyEnumStruct::operator !=( size_t MyEnumStruct::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return MyEnumStruct_max_cdr_typesize; } size_t MyEnumStruct::getCdrSerializedSize( @@ -168,14 +252,12 @@ MyEnum& MyEnumStruct::my_enum() } + size_t MyEnumStruct::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - return current_align; + static_cast(current_alignment); + return MyEnumStruct_max_key_cdr_typesize; } bool MyEnumStruct::isKeyDefined() @@ -187,12 +269,11 @@ void MyEnumStruct::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - } MyBadEnumStruct::MyBadEnumStruct() { - // m_my_enum com.eprosima.idl.parser.typecode.EnumTypeCode@36b4cef0 + // MyBadEnum m_my_enum m_my_enum = ::A1; // Just to register all known types @@ -210,7 +291,7 @@ MyBadEnumStruct::MyBadEnumStruct( } MyBadEnumStruct::MyBadEnumStruct( - MyBadEnumStruct&& x) noexcept + MyBadEnumStruct&& x) noexcept { m_my_enum = x.m_my_enum; } @@ -249,13 +330,8 @@ bool MyBadEnumStruct::operator !=( size_t MyBadEnumStruct::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return MyBadEnumStruct_max_cdr_typesize; } size_t MyBadEnumStruct::getCdrSerializedSize( @@ -321,14 +397,12 @@ MyBadEnum& MyBadEnumStruct::my_enum() } + size_t MyBadEnumStruct::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - return current_align; + static_cast(current_alignment); + return MyBadEnumStruct_max_key_cdr_typesize; } bool MyBadEnumStruct::isKeyDefined() @@ -340,13 +414,12 @@ void MyBadEnumStruct::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - } MyAliasEnumStruct::MyAliasEnumStruct() { - // m_my_enum com.eprosima.idl.parser.typecode.AliasTypeCode@32d2fa64 + // MyAliasEnum m_my_enum m_my_enum = ::A; // Just to register all known types @@ -364,7 +437,7 @@ MyAliasEnumStruct::MyAliasEnumStruct( } MyAliasEnumStruct::MyAliasEnumStruct( - MyAliasEnumStruct&& x) noexcept + MyAliasEnumStruct&& x) noexcept { m_my_enum = x.m_my_enum; } @@ -403,13 +476,8 @@ bool MyAliasEnumStruct::operator !=( size_t MyAliasEnumStruct::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return MyAliasEnumStruct_max_cdr_typesize; } size_t MyAliasEnumStruct::getCdrSerializedSize( @@ -475,14 +543,12 @@ MyAliasEnum& MyAliasEnumStruct::my_enum() } + size_t MyAliasEnumStruct::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - return current_align; + static_cast(current_alignment); + return MyAliasEnumStruct_max_key_cdr_typesize; } bool MyAliasEnumStruct::isKeyDefined() @@ -494,16 +560,15 @@ void MyAliasEnumStruct::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - } BasicStruct::BasicStruct() { - // m_my_bool com.eprosima.idl.parser.typecode.PrimitiveTypeCode@371a67ec + // boolean m_my_bool m_my_bool = false; - // m_my_int32 com.eprosima.idl.parser.typecode.PrimitiveTypeCode@5ed828d + // long m_my_int32 m_my_int32 = 0; - // m_my_string com.eprosima.idl.parser.typecode.StringTypeCode@50d0686 + // string m_my_string m_my_string =""; // Just to register all known types @@ -526,7 +591,7 @@ BasicStruct::BasicStruct( } BasicStruct::BasicStruct( - BasicStruct&& x) noexcept + BasicStruct&& x) noexcept { m_my_bool = x.m_my_bool; m_my_int32 = x.m_my_int32; @@ -571,19 +636,8 @@ bool BasicStruct::operator !=( size_t BasicStruct::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + 255 + 1; - - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return BasicStruct_max_cdr_typesize; } size_t BasicStruct::getCdrSerializedSize( @@ -719,17 +773,12 @@ std::string& BasicStruct::my_string() return m_my_string; } + size_t BasicStruct::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - - - - return current_align; + static_cast(current_alignment); + return BasicStruct_max_key_cdr_typesize; } bool BasicStruct::isKeyDefined() @@ -741,16 +790,15 @@ void BasicStruct::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - } BasicNamesStruct::BasicNamesStruct() { - // m_my_bool_name com.eprosima.idl.parser.typecode.PrimitiveTypeCode@ed9d034 + // boolean m_my_bool_name m_my_bool_name = false; - // m_my_int32_name com.eprosima.idl.parser.typecode.PrimitiveTypeCode@6121c9d6 + // long m_my_int32_name m_my_int32_name = 0; - // m_my_string_name com.eprosima.idl.parser.typecode.StringTypeCode@87f383f + // string m_my_string_name m_my_string_name =""; // Just to register all known types @@ -773,7 +821,7 @@ BasicNamesStruct::BasicNamesStruct( } BasicNamesStruct::BasicNamesStruct( - BasicNamesStruct&& x) noexcept + BasicNamesStruct&& x) noexcept { m_my_bool_name = x.m_my_bool_name; m_my_int32_name = x.m_my_int32_name; @@ -818,19 +866,8 @@ bool BasicNamesStruct::operator !=( size_t BasicNamesStruct::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + 255 + 1; - - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return BasicNamesStruct_max_cdr_typesize; } size_t BasicNamesStruct::getCdrSerializedSize( @@ -966,17 +1003,12 @@ std::string& BasicNamesStruct::my_string_name() return m_my_string_name; } + size_t BasicNamesStruct::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - - - - return current_align; + static_cast(current_alignment); + return BasicNamesStruct_max_key_cdr_typesize; } bool BasicNamesStruct::isKeyDefined() @@ -988,16 +1020,15 @@ void BasicNamesStruct::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - } BasicBadStruct::BasicBadStruct() { - // m_my_bool com.eprosima.idl.parser.typecode.PrimitiveTypeCode@491cc5c9 + // octet m_my_bool m_my_bool = 0; - // m_my_int32 com.eprosima.idl.parser.typecode.PrimitiveTypeCode@74ad1f1f + // long m_my_int32 m_my_int32 = 0; - // m_my_string com.eprosima.idl.parser.typecode.StringTypeCode@6a1aab78 + // string m_my_string m_my_string =""; // Just to register all known types @@ -1020,7 +1051,7 @@ BasicBadStruct::BasicBadStruct( } BasicBadStruct::BasicBadStruct( - BasicBadStruct&& x) noexcept + BasicBadStruct&& x) noexcept { m_my_bool = x.m_my_bool; m_my_int32 = x.m_my_int32; @@ -1065,19 +1096,8 @@ bool BasicBadStruct::operator !=( size_t BasicBadStruct::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + 255 + 1; - - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return BasicBadStruct_max_cdr_typesize; } size_t BasicBadStruct::getCdrSerializedSize( @@ -1213,17 +1233,12 @@ std::string& BasicBadStruct::my_string() return m_my_string; } + size_t BasicBadStruct::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - - - - return current_align; + static_cast(current_alignment); + return BasicBadStruct_max_key_cdr_typesize; } bool BasicBadStruct::isKeyDefined() @@ -1235,20 +1250,19 @@ void BasicBadStruct::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - } BasicWideStruct::BasicWideStruct() { - // m_my_bool com.eprosima.idl.parser.typecode.PrimitiveTypeCode@8646db9 + // boolean m_my_bool m_my_bool = false; - // m_my_int32 com.eprosima.idl.parser.typecode.PrimitiveTypeCode@37374a5e + // long m_my_int32 m_my_int32 = 0; - // m_my_string com.eprosima.idl.parser.typecode.StringTypeCode@4671e53b + // string m_my_string m_my_string =""; - // m_new_int32 com.eprosima.idl.parser.typecode.PrimitiveTypeCode@6950e31 + // long m_new_int32 m_new_int32 = 0; - // m_new_string com.eprosima.idl.parser.typecode.StringTypeCode@42eca56e + // string m_new_string m_new_string =""; // Just to register all known types @@ -1275,7 +1289,7 @@ BasicWideStruct::BasicWideStruct( } BasicWideStruct::BasicWideStruct( - BasicWideStruct&& x) noexcept + BasicWideStruct&& x) noexcept { m_my_bool = x.m_my_bool; m_my_int32 = x.m_my_int32; @@ -1326,24 +1340,8 @@ bool BasicWideStruct::operator !=( size_t BasicWideStruct::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + 255 + 1; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + 255 + 1; - - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return BasicWideStruct_max_cdr_typesize; } size_t BasicWideStruct::getCdrSerializedSize( @@ -1553,19 +1551,12 @@ std::string& BasicWideStruct::new_string() return m_new_string; } + size_t BasicWideStruct::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - - - - - - return current_align; + static_cast(current_alignment); + return BasicWideStruct_max_key_cdr_typesize; } bool BasicWideStruct::isKeyDefined() @@ -1577,20 +1568,19 @@ void BasicWideStruct::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - } BadBasicWideStruct::BadBasicWideStruct() { - // m_new_int32 com.eprosima.idl.parser.typecode.PrimitiveTypeCode@553a3d88 + // long m_new_int32 m_new_int32 = 0; - // m_new_string com.eprosima.idl.parser.typecode.StringTypeCode@7a30d1e6 + // string m_new_string m_new_string =""; - // m_my_bool com.eprosima.idl.parser.typecode.PrimitiveTypeCode@5891e32e + // boolean m_my_bool m_my_bool = false; - // m_my_int32 com.eprosima.idl.parser.typecode.PrimitiveTypeCode@cb0ed20 + // long m_my_int32 m_my_int32 = 0; - // m_my_string com.eprosima.idl.parser.typecode.StringTypeCode@8e24743 + // string m_my_string m_my_string =""; // Just to register all known types @@ -1617,7 +1607,7 @@ BadBasicWideStruct::BadBasicWideStruct( } BadBasicWideStruct::BadBasicWideStruct( - BadBasicWideStruct&& x) noexcept + BadBasicWideStruct&& x) noexcept { m_new_int32 = x.m_new_int32; m_new_string = std::move(x.m_new_string); @@ -1668,24 +1658,8 @@ bool BadBasicWideStruct::operator !=( size_t BadBasicWideStruct::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + 255 + 1; - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + 255 + 1; - - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return BadBasicWideStruct_max_cdr_typesize; } size_t BadBasicWideStruct::getCdrSerializedSize( @@ -1895,19 +1869,12 @@ std::string& BadBasicWideStruct::my_string() return m_my_string; } + size_t BadBasicWideStruct::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - - - - - - return current_align; + static_cast(current_alignment); + return BadBasicWideStruct_max_key_cdr_typesize; } bool BadBasicWideStruct::isKeyDefined() @@ -1919,12 +1886,11 @@ void BadBasicWideStruct::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - } StringStruct::StringStruct() { - // m_my_string com.eprosima.idl.parser.typecode.StringTypeCode@13eb8acf + // string m_my_string m_my_string =""; // Just to register all known types @@ -1942,7 +1908,7 @@ StringStruct::StringStruct( } StringStruct::StringStruct( - StringStruct&& x) noexcept + StringStruct&& x) noexcept { m_my_string = std::move(x.m_my_string); } @@ -1981,12 +1947,8 @@ bool StringStruct::operator !=( size_t StringStruct::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + 255 + 1; - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return StringStruct_max_cdr_typesize; } size_t StringStruct::getCdrSerializedSize( @@ -2054,14 +2016,12 @@ std::string& StringStruct::my_string() return m_my_string; } + size_t StringStruct::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - return current_align; + static_cast(current_alignment); + return StringStruct_max_key_cdr_typesize; } bool StringStruct::isKeyDefined() @@ -2073,12 +2033,11 @@ void StringStruct::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - } LargeStringStruct::LargeStringStruct() { - // m_my_large_string com.eprosima.idl.parser.typecode.StringTypeCode@43738a82 + // string m_my_large_string m_my_large_string =""; // Just to register all known types @@ -2096,7 +2055,7 @@ LargeStringStruct::LargeStringStruct( } LargeStringStruct::LargeStringStruct( - LargeStringStruct&& x) noexcept + LargeStringStruct&& x) noexcept { m_my_large_string = std::move(x.m_my_large_string); } @@ -2135,12 +2094,8 @@ bool LargeStringStruct::operator !=( size_t LargeStringStruct::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + 41925 + 1; - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return LargeStringStruct_max_cdr_typesize; } size_t LargeStringStruct::getCdrSerializedSize( @@ -2212,14 +2167,12 @@ eprosima::fastrtps::fixed_string<41925>& LargeStringStruct::my_large_string() return m_my_large_string; } + size_t LargeStringStruct::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - return current_align; + static_cast(current_alignment); + return LargeStringStruct_max_key_cdr_typesize; } bool LargeStringStruct::isKeyDefined() @@ -2231,12 +2184,11 @@ void LargeStringStruct::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - } WStringStruct::WStringStruct() { - // m_my_wstring com.eprosima.idl.parser.typecode.StringTypeCode@75881071 + // wstring m_my_wstring // Just to register all known types @@ -2254,7 +2206,7 @@ WStringStruct::WStringStruct( } WStringStruct::WStringStruct( - WStringStruct&& x) noexcept + WStringStruct&& x) noexcept { m_my_wstring = std::move(x.m_my_wstring); } @@ -2293,12 +2245,8 @@ bool WStringStruct::operator !=( size_t WStringStruct::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + (255) * 4; // 32 bits - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return WStringStruct_max_cdr_typesize; } size_t WStringStruct::getCdrSerializedSize( @@ -2367,14 +2315,12 @@ std::wstring& WStringStruct::my_wstring() return m_my_wstring; } + size_t WStringStruct::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - return current_align; + static_cast(current_alignment); + return WStringStruct_max_key_cdr_typesize; } bool WStringStruct::isKeyDefined() @@ -2386,12 +2332,11 @@ void WStringStruct::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - } LargeWStringStruct::LargeWStringStruct() { - // m_my_large_wstring com.eprosima.idl.parser.typecode.StringTypeCode@2a70a3d8 + // wstring m_my_large_wstring // Just to register all known types @@ -2409,7 +2354,7 @@ LargeWStringStruct::LargeWStringStruct( } LargeWStringStruct::LargeWStringStruct( - LargeWStringStruct&& x) noexcept + LargeWStringStruct&& x) noexcept { m_my_large_wstring = std::move(x.m_my_large_wstring); } @@ -2448,12 +2393,8 @@ bool LargeWStringStruct::operator !=( size_t LargeWStringStruct::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + (41925) * 4; // 32 bits - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return LargeWStringStruct_max_cdr_typesize; } size_t LargeWStringStruct::getCdrSerializedSize( @@ -2522,14 +2463,12 @@ std::wstring& LargeWStringStruct::my_large_wstring() return m_my_large_wstring; } + size_t LargeWStringStruct::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - return current_align; + static_cast(current_alignment); + return LargeWStringStruct_max_key_cdr_typesize; } bool LargeWStringStruct::isKeyDefined() @@ -2541,12 +2480,11 @@ void LargeWStringStruct::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - } ArrayStruct::ArrayStruct() { - // m_my_array com.eprosima.idl.parser.typecode.ArrayTypeCode@3891771e + // long m_my_array memset(&m_my_array, 0, (2) * 4); // Just to register all known types @@ -2564,7 +2502,7 @@ ArrayStruct::ArrayStruct( } ArrayStruct::ArrayStruct( - ArrayStruct&& x) noexcept + ArrayStruct&& x) noexcept { m_my_array = std::move(x.m_my_array); } @@ -2603,13 +2541,8 @@ bool ArrayStruct::operator !=( size_t ArrayStruct::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += ((2) * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return ArrayStruct_max_cdr_typesize; } size_t ArrayStruct::getCdrSerializedSize( @@ -2680,14 +2613,12 @@ std::array& ArrayStruct::my_array() return m_my_array; } + size_t ArrayStruct::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - return current_align; + static_cast(current_alignment); + return ArrayStruct_max_key_cdr_typesize; } bool ArrayStruct::isKeyDefined() @@ -2699,12 +2630,11 @@ void ArrayStruct::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - } ArrayStructEqual::ArrayStructEqual() { - // m_my_array_equal com.eprosima.idl.parser.typecode.ArrayTypeCode@12c8a2c0 + // long m_my_array_equal memset(&m_my_array_equal, 0, (2) * 4); // Just to register all known types @@ -2722,7 +2652,7 @@ ArrayStructEqual::ArrayStructEqual( } ArrayStructEqual::ArrayStructEqual( - ArrayStructEqual&& x) noexcept + ArrayStructEqual&& x) noexcept { m_my_array_equal = std::move(x.m_my_array_equal); } @@ -2761,13 +2691,8 @@ bool ArrayStructEqual::operator !=( size_t ArrayStructEqual::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += ((2) * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return ArrayStructEqual_max_cdr_typesize; } size_t ArrayStructEqual::getCdrSerializedSize( @@ -2838,14 +2763,12 @@ std::array& ArrayStructEqual::my_array_equal() return m_my_array_equal; } + size_t ArrayStructEqual::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - return current_align; + static_cast(current_alignment); + return ArrayStructEqual_max_key_cdr_typesize; } bool ArrayStructEqual::isKeyDefined() @@ -2857,12 +2780,11 @@ void ArrayStructEqual::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - } ArrayBadStruct::ArrayBadStruct() { - // m_my_array com.eprosima.idl.parser.typecode.ArrayTypeCode@365185bd + // octet m_my_array memset(&m_my_array, 0, (2) * 1); // Just to register all known types @@ -2880,7 +2802,7 @@ ArrayBadStruct::ArrayBadStruct( } ArrayBadStruct::ArrayBadStruct( - ArrayBadStruct&& x) noexcept + ArrayBadStruct&& x) noexcept { m_my_array = std::move(x.m_my_array); } @@ -2919,13 +2841,8 @@ bool ArrayBadStruct::operator !=( size_t ArrayBadStruct::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += ((2) * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return ArrayBadStruct_max_cdr_typesize; } size_t ArrayBadStruct::getCdrSerializedSize( @@ -2996,14 +2913,12 @@ std::array& ArrayBadStruct::my_array() return m_my_array; } + size_t ArrayBadStruct::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - return current_align; + static_cast(current_alignment); + return ArrayBadStruct_max_key_cdr_typesize; } bool ArrayBadStruct::isKeyDefined() @@ -3015,12 +2930,11 @@ void ArrayBadStruct::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - } ArrayDimensionsStruct::ArrayDimensionsStruct() { - // m_my_array com.eprosima.idl.parser.typecode.ArrayTypeCode@42607a4f + // long m_my_array memset(&m_my_array, 0, (2 * 2) * 4); // Just to register all known types @@ -3038,7 +2952,7 @@ ArrayDimensionsStruct::ArrayDimensionsStruct( } ArrayDimensionsStruct::ArrayDimensionsStruct( - ArrayDimensionsStruct&& x) noexcept + ArrayDimensionsStruct&& x) noexcept { m_my_array = std::move(x.m_my_array); } @@ -3077,13 +2991,8 @@ bool ArrayDimensionsStruct::operator !=( size_t ArrayDimensionsStruct::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += ((2 * 2) * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return ArrayDimensionsStruct_max_cdr_typesize; } size_t ArrayDimensionsStruct::getCdrSerializedSize( @@ -3154,14 +3063,12 @@ std::array, 2>& ArrayDimensionsStruct::my_array() return m_my_array; } + size_t ArrayDimensionsStruct::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - return current_align; + static_cast(current_alignment); + return ArrayDimensionsStruct_max_key_cdr_typesize; } bool ArrayDimensionsStruct::isKeyDefined() @@ -3173,12 +3080,11 @@ void ArrayDimensionsStruct::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - } ArraySizeStruct::ArraySizeStruct() { - // m_my_array com.eprosima.idl.parser.typecode.ArrayTypeCode@7276c8cd + // long m_my_array memset(&m_my_array, 0, (5) * 4); // Just to register all known types @@ -3196,7 +3102,7 @@ ArraySizeStruct::ArraySizeStruct( } ArraySizeStruct::ArraySizeStruct( - ArraySizeStruct&& x) noexcept + ArraySizeStruct&& x) noexcept { m_my_array = std::move(x.m_my_array); } @@ -3235,13 +3141,8 @@ bool ArraySizeStruct::operator !=( size_t ArraySizeStruct::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += ((5) * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return ArraySizeStruct_max_cdr_typesize; } size_t ArraySizeStruct::getCdrSerializedSize( @@ -3312,14 +3213,12 @@ std::array& ArraySizeStruct::my_array() return m_my_array; } + size_t ArraySizeStruct::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - return current_align; + static_cast(current_alignment); + return ArraySizeStruct_max_key_cdr_typesize; } bool ArraySizeStruct::isKeyDefined() @@ -3331,12 +3230,11 @@ void ArraySizeStruct::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - } SequenceStruct::SequenceStruct() { - // m_my_sequence com.eprosima.idl.parser.typecode.SequenceTypeCode@3b94d659 + // sequence m_my_sequence // Just to register all known types @@ -3354,7 +3252,7 @@ SequenceStruct::SequenceStruct( } SequenceStruct::SequenceStruct( - SequenceStruct&& x) noexcept + SequenceStruct&& x) noexcept { m_my_sequence = std::move(x.m_my_sequence); } @@ -3393,16 +3291,8 @@ bool SequenceStruct::operator !=( size_t SequenceStruct::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - current_alignment += (2 * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return SequenceStruct_max_cdr_typesize; } size_t SequenceStruct::getCdrSerializedSize( @@ -3476,14 +3366,12 @@ std::vector& SequenceStruct::my_sequence() return m_my_sequence; } + size_t SequenceStruct::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - return current_align; + static_cast(current_alignment); + return SequenceStruct_max_key_cdr_typesize; } bool SequenceStruct::isKeyDefined() @@ -3495,12 +3383,11 @@ void SequenceStruct::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - } SequenceStructEqual::SequenceStructEqual() { - // m_my_sequence_equal com.eprosima.idl.parser.typecode.SequenceTypeCode@24b1d79b + // sequence m_my_sequence_equal // Just to register all known types @@ -3518,7 +3405,7 @@ SequenceStructEqual::SequenceStructEqual( } SequenceStructEqual::SequenceStructEqual( - SequenceStructEqual&& x) noexcept + SequenceStructEqual&& x) noexcept { m_my_sequence_equal = std::move(x.m_my_sequence_equal); } @@ -3557,16 +3444,8 @@ bool SequenceStructEqual::operator !=( size_t SequenceStructEqual::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - current_alignment += (2 * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return SequenceStructEqual_max_cdr_typesize; } size_t SequenceStructEqual::getCdrSerializedSize( @@ -3640,14 +3519,12 @@ std::vector& SequenceStructEqual::my_sequence_equal() return m_my_sequence_equal; } + size_t SequenceStructEqual::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - return current_align; + static_cast(current_alignment); + return SequenceStructEqual_max_key_cdr_typesize; } bool SequenceStructEqual::isKeyDefined() @@ -3659,12 +3536,11 @@ void SequenceStructEqual::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - } SequenceBadStruct::SequenceBadStruct() { - // m_my_sequence com.eprosima.idl.parser.typecode.SequenceTypeCode@281e3708 + // sequence m_my_sequence // Just to register all known types @@ -3682,7 +3558,7 @@ SequenceBadStruct::SequenceBadStruct( } SequenceBadStruct::SequenceBadStruct( - SequenceBadStruct&& x) noexcept + SequenceBadStruct&& x) noexcept { m_my_sequence = std::move(x.m_my_sequence); } @@ -3721,16 +3597,8 @@ bool SequenceBadStruct::operator !=( size_t SequenceBadStruct::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - current_alignment += (2 * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return SequenceBadStruct_max_cdr_typesize; } size_t SequenceBadStruct::getCdrSerializedSize( @@ -3804,14 +3672,12 @@ std::vector& SequenceBadStruct::my_sequence() return m_my_sequence; } + size_t SequenceBadStruct::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - return current_align; + static_cast(current_alignment); + return SequenceBadStruct_max_key_cdr_typesize; } bool SequenceBadStruct::isKeyDefined() @@ -3823,12 +3689,11 @@ void SequenceBadStruct::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - } SequenceBoundsStruct::SequenceBoundsStruct() { - // m_my_sequence com.eprosima.idl.parser.typecode.SequenceTypeCode@103f852 + // sequence m_my_sequence // Just to register all known types @@ -3846,7 +3711,7 @@ SequenceBoundsStruct::SequenceBoundsStruct( } SequenceBoundsStruct::SequenceBoundsStruct( - SequenceBoundsStruct&& x) noexcept + SequenceBoundsStruct&& x) noexcept { m_my_sequence = std::move(x.m_my_sequence); } @@ -3885,16 +3750,8 @@ bool SequenceBoundsStruct::operator !=( size_t SequenceBoundsStruct::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - current_alignment += (4 * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return SequenceBoundsStruct_max_cdr_typesize; } size_t SequenceBoundsStruct::getCdrSerializedSize( @@ -3968,14 +3825,12 @@ std::vector& SequenceBoundsStruct::my_sequence() return m_my_sequence; } + size_t SequenceBoundsStruct::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - return current_align; + static_cast(current_alignment); + return SequenceBoundsStruct_max_key_cdr_typesize; } bool SequenceBoundsStruct::isKeyDefined() @@ -3987,12 +3842,11 @@ void SequenceBoundsStruct::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - } SequenceSequenceStruct::SequenceSequenceStruct() { - // m_my_sequence_sequence com.eprosima.idl.parser.typecode.SequenceTypeCode@77a57272 + // sequence, 3> m_my_sequence_sequence // Just to register all known types @@ -4010,7 +3864,7 @@ SequenceSequenceStruct::SequenceSequenceStruct( } SequenceSequenceStruct::SequenceSequenceStruct( - SequenceSequenceStruct&& x) noexcept + SequenceSequenceStruct&& x) noexcept { m_my_sequence_sequence = std::move(x.m_my_sequence_sequence); } @@ -4049,22 +3903,8 @@ bool SequenceSequenceStruct::operator !=( size_t SequenceSequenceStruct::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - for(size_t a = 0; a < 3; ++a) - { - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - current_alignment += (2 * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - } - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return SequenceSequenceStruct_max_cdr_typesize; } size_t SequenceSequenceStruct::getCdrSerializedSize( @@ -4144,14 +3984,12 @@ std::vector>& SequenceSequenceStruct::my_sequence_sequence( return m_my_sequence_sequence; } + size_t SequenceSequenceStruct::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - return current_align; + static_cast(current_alignment); + return SequenceSequenceStruct_max_key_cdr_typesize; } bool SequenceSequenceStruct::isKeyDefined() @@ -4163,12 +4001,11 @@ void SequenceSequenceStruct::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - } SequenceSequenceBoundsStruct::SequenceSequenceBoundsStruct() { - // m_my_sequence_sequence com.eprosima.idl.parser.typecode.SequenceTypeCode@6e2c9341 + // sequence, 5> m_my_sequence_sequence // Just to register all known types @@ -4186,7 +4023,7 @@ SequenceSequenceBoundsStruct::SequenceSequenceBoundsStruct( } SequenceSequenceBoundsStruct::SequenceSequenceBoundsStruct( - SequenceSequenceBoundsStruct&& x) noexcept + SequenceSequenceBoundsStruct&& x) noexcept { m_my_sequence_sequence = std::move(x.m_my_sequence_sequence); } @@ -4225,22 +4062,8 @@ bool SequenceSequenceBoundsStruct::operator !=( size_t SequenceSequenceBoundsStruct::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - for(size_t a = 0; a < 5; ++a) - { - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - current_alignment += (5 * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - } - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return SequenceSequenceBoundsStruct_max_cdr_typesize; } size_t SequenceSequenceBoundsStruct::getCdrSerializedSize( @@ -4320,14 +4143,12 @@ std::vector>& SequenceSequenceBoundsStruct::my_sequence_seq return m_my_sequence_sequence; } + size_t SequenceSequenceBoundsStruct::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - return current_align; + static_cast(current_alignment); + return SequenceSequenceBoundsStruct_max_key_cdr_typesize; } bool SequenceSequenceBoundsStruct::isKeyDefined() @@ -4339,12 +4160,11 @@ void SequenceSequenceBoundsStruct::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - } MapStruct::MapStruct() { - // m_my_map com.eprosima.idl.parser.typecode.MapTypeCode@4e4aea35 + // map m_my_map // Just to register all known types @@ -4362,7 +4182,7 @@ MapStruct::MapStruct( } MapStruct::MapStruct( - MapStruct&& x) noexcept + MapStruct&& x) noexcept { m_my_map = std::move(x.m_my_map); } @@ -4401,23 +4221,8 @@ bool MapStruct::operator !=( size_t MapStruct::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - for(size_t a = 0; a < 2; ++a) - { - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - } - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return MapStruct_max_cdr_typesize; } size_t MapStruct::getCdrSerializedSize( @@ -4494,14 +4299,12 @@ std::map& MapStruct::my_map() return m_my_map; } + size_t MapStruct::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - return current_align; + static_cast(current_alignment); + return MapStruct_max_key_cdr_typesize; } bool MapStruct::isKeyDefined() @@ -4513,12 +4316,11 @@ void MapStruct::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - } MapStructEqual::MapStructEqual() { - // m_my_map_equal com.eprosima.idl.parser.typecode.MapTypeCode@1442d7b5 + // map m_my_map_equal // Just to register all known types @@ -4536,7 +4338,7 @@ MapStructEqual::MapStructEqual( } MapStructEqual::MapStructEqual( - MapStructEqual&& x) noexcept + MapStructEqual&& x) noexcept { m_my_map_equal = std::move(x.m_my_map_equal); } @@ -4575,23 +4377,8 @@ bool MapStructEqual::operator !=( size_t MapStructEqual::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - for(size_t a = 0; a < 2; ++a) - { - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - } - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return MapStructEqual_max_cdr_typesize; } size_t MapStructEqual::getCdrSerializedSize( @@ -4668,14 +4455,12 @@ std::map& MapStructEqual::my_map_equal() return m_my_map_equal; } + size_t MapStructEqual::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - return current_align; + static_cast(current_alignment); + return MapStructEqual_max_key_cdr_typesize; } bool MapStructEqual::isKeyDefined() @@ -4687,12 +4472,11 @@ void MapStructEqual::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - } MapBadKeyStruct::MapBadKeyStruct() { - // m_my_map com.eprosima.idl.parser.typecode.MapTypeCode@1ee807c6 + // map m_my_map // Just to register all known types @@ -4710,7 +4494,7 @@ MapBadKeyStruct::MapBadKeyStruct( } MapBadKeyStruct::MapBadKeyStruct( - MapBadKeyStruct&& x) noexcept + MapBadKeyStruct&& x) noexcept { m_my_map = std::move(x.m_my_map); } @@ -4749,23 +4533,8 @@ bool MapBadKeyStruct::operator !=( size_t MapBadKeyStruct::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - for(size_t a = 0; a < 2; ++a) - { - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - } - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return MapBadKeyStruct_max_cdr_typesize; } size_t MapBadKeyStruct::getCdrSerializedSize( @@ -4842,14 +4611,12 @@ std::map& MapBadKeyStruct::my_map() return m_my_map; } + size_t MapBadKeyStruct::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - return current_align; + static_cast(current_alignment); + return MapBadKeyStruct_max_key_cdr_typesize; } bool MapBadKeyStruct::isKeyDefined() @@ -4861,12 +4628,11 @@ void MapBadKeyStruct::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - } MapBadElemStruct::MapBadElemStruct() { - // m_my_map com.eprosima.idl.parser.typecode.MapTypeCode@76a4d6c + // map m_my_map // Just to register all known types @@ -4884,7 +4650,7 @@ MapBadElemStruct::MapBadElemStruct( } MapBadElemStruct::MapBadElemStruct( - MapBadElemStruct&& x) noexcept + MapBadElemStruct&& x) noexcept { m_my_map = std::move(x.m_my_map); } @@ -4920,26 +4686,11 @@ bool MapBadElemStruct::operator !=( return !(*this == x); } -size_t MapBadElemStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - for(size_t a = 0; a < 2; ++a) - { - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - - current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - - } - - return current_alignment - initial_alignment; +size_t MapBadElemStruct::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return MapBadElemStruct_max_cdr_typesize; } size_t MapBadElemStruct::getCdrSerializedSize( @@ -5016,14 +4767,12 @@ std::map& MapBadElemStruct::my_map() return m_my_map; } + size_t MapBadElemStruct::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - return current_align; + static_cast(current_alignment); + return MapBadElemStruct_max_key_cdr_typesize; } bool MapBadElemStruct::isKeyDefined() @@ -5035,12 +4784,11 @@ void MapBadElemStruct::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - } MapBoundsStruct::MapBoundsStruct() { - // m_my_map com.eprosima.idl.parser.typecode.MapTypeCode@679b62af + // map m_my_map // Just to register all known types @@ -5058,7 +4806,7 @@ MapBoundsStruct::MapBoundsStruct( } MapBoundsStruct::MapBoundsStruct( - MapBoundsStruct&& x) noexcept + MapBoundsStruct&& x) noexcept { m_my_map = std::move(x.m_my_map); } @@ -5097,23 +4845,8 @@ bool MapBoundsStruct::operator !=( size_t MapBoundsStruct::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - for(size_t a = 0; a < 4; ++a) - { - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - } - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return MapBoundsStruct_max_cdr_typesize; } size_t MapBoundsStruct::getCdrSerializedSize( @@ -5190,14 +4923,12 @@ std::map& MapBoundsStruct::my_map() return m_my_map; } + size_t MapBoundsStruct::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - return current_align; + static_cast(current_alignment); + return MapBoundsStruct_max_key_cdr_typesize; } bool MapBoundsStruct::isKeyDefined() @@ -5209,12 +4940,11 @@ void MapBoundsStruct::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - } MapMapStruct::MapMapStruct() { - // m_my_map_map com.eprosima.idl.parser.typecode.MapTypeCode@d6da883 + // map> m_my_map_map // Just to register all known types @@ -5232,7 +4962,7 @@ MapMapStruct::MapMapStruct( } MapMapStruct::MapMapStruct( - MapMapStruct&& x) noexcept + MapMapStruct&& x) noexcept { m_my_map_map = std::move(x.m_my_map_map); } @@ -5271,32 +5001,8 @@ bool MapMapStruct::operator !=( size_t MapMapStruct::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - for(size_t a = 0; a < 2; ++a) - { - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - for(size_t b = 0; b < 2; ++b) - { - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - } - } - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return MapMapStruct_max_cdr_typesize; } size_t MapMapStruct::getCdrSerializedSize( @@ -5382,14 +5088,12 @@ std::map>& MapMapStruct::my_map_map() return m_my_map_map; } + size_t MapMapStruct::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - return current_align; + static_cast(current_alignment); + return MapMapStruct_max_key_cdr_typesize; } bool MapMapStruct::isKeyDefined() @@ -5401,12 +5105,11 @@ void MapMapStruct::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - } MapMapBoundsStruct::MapMapBoundsStruct() { - // m_my_map_map com.eprosima.idl.parser.typecode.MapTypeCode@799d4f69 + // map> m_my_map_map // Just to register all known types @@ -5424,7 +5127,7 @@ MapMapBoundsStruct::MapMapBoundsStruct( } MapMapBoundsStruct::MapMapBoundsStruct( - MapMapBoundsStruct&& x) noexcept + MapMapBoundsStruct&& x) noexcept { m_my_map_map = std::move(x.m_my_map_map); } @@ -5463,32 +5166,8 @@ bool MapMapBoundsStruct::operator !=( size_t MapMapBoundsStruct::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - for(size_t a = 0; a < 3; ++a) - { - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - for(size_t b = 0; b < 3; ++b) - { - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - } - } - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return MapMapBoundsStruct_max_cdr_typesize; } size_t MapMapBoundsStruct::getCdrSerializedSize( @@ -5574,14 +5253,12 @@ std::map>& MapMapBoundsStruct::my_map_map() return m_my_map_map; } + size_t MapMapBoundsStruct::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - return current_align; + static_cast(current_alignment); + return MapMapBoundsStruct_max_key_cdr_typesize; } bool MapMapBoundsStruct::isKeyDefined() @@ -5593,15 +5270,14 @@ void MapMapBoundsStruct::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - } SimpleUnion::SimpleUnion() { m__d = A; - // m_first com.eprosima.idl.parser.typecode.PrimitiveTypeCode@701fc37a + // long m_first m_first = 0; - // m_second com.eprosima.idl.parser.typecode.PrimitiveTypeCode@4148db48 + // long long m_second m_second = 0; } @@ -5853,38 +5529,6 @@ int64_t& SimpleUnion::second() return m_second; } -size_t SimpleUnion::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - size_t reset_alignment = 0; - size_t union_max_size_serialized = 0; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - reset_alignment = current_alignment; - - reset_alignment += 4 + eprosima::fastcdr::Cdr::alignment(reset_alignment, 4); - - - if(union_max_size_serialized < reset_alignment) - union_max_size_serialized = reset_alignment; - - - reset_alignment = current_alignment; - - reset_alignment += 8 + eprosima::fastcdr::Cdr::alignment(reset_alignment, 8); - - - if(union_max_size_serialized < reset_alignment) - union_max_size_serialized = reset_alignment; - - - - return union_max_size_serialized - initial_alignment; -} - // TODO(Ricardo) Review size_t SimpleUnion::getCdrSerializedSize( const SimpleUnion& data, @@ -5954,9 +5598,9 @@ void SimpleUnion::deserialize( SimpleUnionNames::SimpleUnionNames() { m__d = A; - // m_first_case com.eprosima.idl.parser.typecode.PrimitiveTypeCode@76329302 + // long m_first_case m_first_case = 0; - // m_second_case com.eprosima.idl.parser.typecode.PrimitiveTypeCode@5e25a92e + // long long m_second_case m_second_case = 0; } @@ -6208,38 +5852,6 @@ int64_t& SimpleUnionNames::second_case() return m_second_case; } -size_t SimpleUnionNames::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - size_t reset_alignment = 0; - size_t union_max_size_serialized = 0; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - reset_alignment = current_alignment; - - reset_alignment += 4 + eprosima::fastcdr::Cdr::alignment(reset_alignment, 4); - - - if(union_max_size_serialized < reset_alignment) - union_max_size_serialized = reset_alignment; - - - reset_alignment = current_alignment; - - reset_alignment += 8 + eprosima::fastcdr::Cdr::alignment(reset_alignment, 8); - - - if(union_max_size_serialized < reset_alignment) - union_max_size_serialized = reset_alignment; - - - - return union_max_size_serialized - initial_alignment; -} - // TODO(Ricardo) Review size_t SimpleUnionNames::getCdrSerializedSize( const SimpleUnionNames& data, @@ -6309,9 +5921,9 @@ void SimpleUnionNames::deserialize( SimpleTypeUnion::SimpleTypeUnion() { m__d = A; - // m_first com.eprosima.idl.parser.typecode.PrimitiveTypeCode@11e21d0e + // octet m_first m_first = 0; - // m_second com.eprosima.idl.parser.typecode.PrimitiveTypeCode@1dd02175 + // long long m_second m_second = 0; } @@ -6563,38 +6175,6 @@ int64_t& SimpleTypeUnion::second() return m_second; } -size_t SimpleTypeUnion::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - size_t reset_alignment = 0; - size_t union_max_size_serialized = 0; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - reset_alignment = current_alignment; - - reset_alignment += 1 + eprosima::fastcdr::Cdr::alignment(reset_alignment, 1); - - - if(union_max_size_serialized < reset_alignment) - union_max_size_serialized = reset_alignment; - - - reset_alignment = current_alignment; - - reset_alignment += 8 + eprosima::fastcdr::Cdr::alignment(reset_alignment, 8); - - - if(union_max_size_serialized < reset_alignment) - union_max_size_serialized = reset_alignment; - - - - return union_max_size_serialized - initial_alignment; -} - // TODO(Ricardo) Review size_t SimpleTypeUnion::getCdrSerializedSize( const SimpleTypeUnion& data, @@ -6664,9 +6244,9 @@ void SimpleTypeUnion::deserialize( SimpleBadUnion::SimpleBadUnion() { m__d = A; - // m_first com.eprosima.idl.parser.typecode.PrimitiveTypeCode@31206beb + // long m_first m_first = 0; - // m_second com.eprosima.idl.parser.typecode.PrimitiveTypeCode@3e77a1ed + // long long m_second m_second = 0; } @@ -6918,38 +6498,6 @@ int64_t& SimpleBadUnion::second() return m_second; } -size_t SimpleBadUnion::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - size_t reset_alignment = 0; - size_t union_max_size_serialized = 0; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - reset_alignment = current_alignment; - - reset_alignment += 4 + eprosima::fastcdr::Cdr::alignment(reset_alignment, 4); - - - if(union_max_size_serialized < reset_alignment) - union_max_size_serialized = reset_alignment; - - - reset_alignment = current_alignment; - - reset_alignment += 8 + eprosima::fastcdr::Cdr::alignment(reset_alignment, 8); - - - if(union_max_size_serialized < reset_alignment) - union_max_size_serialized = reset_alignment; - - - - return union_max_size_serialized - initial_alignment; -} - // TODO(Ricardo) Review size_t SimpleBadUnion::getCdrSerializedSize( const SimpleBadUnion& data, @@ -7019,9 +6567,9 @@ void SimpleBadUnion::deserialize( SimpleBadDiscUnion::SimpleBadDiscUnion() { m__d = 0; - // m_first com.eprosima.idl.parser.typecode.PrimitiveTypeCode@23bb8443 + // long m_first m_first = 0; - // m_second com.eprosima.idl.parser.typecode.PrimitiveTypeCode@1176dcec + // long long m_second m_second = 0; } @@ -7273,38 +6821,6 @@ int64_t& SimpleBadDiscUnion::second() return m_second; } -size_t SimpleBadDiscUnion::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - size_t reset_alignment = 0; - size_t union_max_size_serialized = 0; - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - reset_alignment = current_alignment; - - reset_alignment += 4 + eprosima::fastcdr::Cdr::alignment(reset_alignment, 4); - - - if(union_max_size_serialized < reset_alignment) - union_max_size_serialized = reset_alignment; - - - reset_alignment = current_alignment; - - reset_alignment += 8 + eprosima::fastcdr::Cdr::alignment(reset_alignment, 8); - - - if(union_max_size_serialized < reset_alignment) - union_max_size_serialized = reset_alignment; - - - - return union_max_size_serialized - initial_alignment; -} - // TODO(Ricardo) Review size_t SimpleBadDiscUnion::getCdrSerializedSize( const SimpleBadDiscUnion& data, @@ -7373,7 +6889,7 @@ void SimpleBadDiscUnion::deserialize( SimpleUnionStruct::SimpleUnionStruct() { - // m_my_union com.eprosima.idl.parser.typecode.UnionTypeCode@120d6fe6 + // SimpleUnion m_my_union // Just to register all known types @@ -7391,7 +6907,7 @@ SimpleUnionStruct::SimpleUnionStruct( } SimpleUnionStruct::SimpleUnionStruct( - SimpleUnionStruct&& x) noexcept + SimpleUnionStruct&& x) noexcept { m_my_union = std::move(x.m_my_union); } @@ -7430,12 +6946,8 @@ bool SimpleUnionStruct::operator !=( size_t SimpleUnionStruct::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += SimpleUnion::getMaxCdrSerializedSize(current_alignment); - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return SimpleUnionStruct_max_cdr_typesize; } size_t SimpleUnionStruct::getCdrSerializedSize( @@ -7504,14 +7016,12 @@ SimpleUnion& SimpleUnionStruct::my_union() return m_my_union; } + size_t SimpleUnionStruct::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - return current_align; + static_cast(current_alignment); + return SimpleUnionStruct_max_key_cdr_typesize; } bool SimpleUnionStruct::isKeyDefined() @@ -7523,12 +7033,11 @@ void SimpleUnionStruct::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - } SimpleUnionStructEqual::SimpleUnionStructEqual() { - // m_my_union_equal com.eprosima.idl.parser.typecode.UnionTypeCode@120d6fe6 + // SimpleUnion m_my_union_equal // Just to register all known types @@ -7546,7 +7055,7 @@ SimpleUnionStructEqual::SimpleUnionStructEqual( } SimpleUnionStructEqual::SimpleUnionStructEqual( - SimpleUnionStructEqual&& x) noexcept + SimpleUnionStructEqual&& x) noexcept { m_my_union_equal = std::move(x.m_my_union_equal); } @@ -7585,12 +7094,8 @@ bool SimpleUnionStructEqual::operator !=( size_t SimpleUnionStructEqual::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += SimpleUnion::getMaxCdrSerializedSize(current_alignment); - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return SimpleUnionStructEqual_max_cdr_typesize; } size_t SimpleUnionStructEqual::getCdrSerializedSize( @@ -7659,14 +7164,12 @@ SimpleUnion& SimpleUnionStructEqual::my_union_equal() return m_my_union_equal; } + size_t SimpleUnionStructEqual::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - return current_align; + static_cast(current_alignment); + return SimpleUnionStructEqual_max_key_cdr_typesize; } bool SimpleUnionStructEqual::isKeyDefined() @@ -7678,12 +7181,11 @@ void SimpleUnionStructEqual::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - } SimpleUnionNamesStruct::SimpleUnionNamesStruct() { - // m_my_union com.eprosima.idl.parser.typecode.UnionTypeCode@3444d69d + // SimpleUnionNames m_my_union // Just to register all known types @@ -7701,7 +7203,7 @@ SimpleUnionNamesStruct::SimpleUnionNamesStruct( } SimpleUnionNamesStruct::SimpleUnionNamesStruct( - SimpleUnionNamesStruct&& x) noexcept + SimpleUnionNamesStruct&& x) noexcept { m_my_union = std::move(x.m_my_union); } @@ -7740,12 +7242,8 @@ bool SimpleUnionNamesStruct::operator !=( size_t SimpleUnionNamesStruct::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += SimpleUnionNames::getMaxCdrSerializedSize(current_alignment); - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return SimpleUnionNamesStruct_max_cdr_typesize; } size_t SimpleUnionNamesStruct::getCdrSerializedSize( @@ -7814,14 +7312,12 @@ SimpleUnionNames& SimpleUnionNamesStruct::my_union() return m_my_union; } + size_t SimpleUnionNamesStruct::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - return current_align; + static_cast(current_alignment); + return SimpleUnionNamesStruct_max_key_cdr_typesize; } bool SimpleUnionNamesStruct::isKeyDefined() @@ -7833,12 +7329,11 @@ void SimpleUnionNamesStruct::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - } SimpleTypeUnionStruct::SimpleTypeUnionStruct() { - // m_my_union com.eprosima.idl.parser.typecode.UnionTypeCode@1372ed45 + // SimpleTypeUnion m_my_union // Just to register all known types @@ -7856,7 +7351,7 @@ SimpleTypeUnionStruct::SimpleTypeUnionStruct( } SimpleTypeUnionStruct::SimpleTypeUnionStruct( - SimpleTypeUnionStruct&& x) noexcept + SimpleTypeUnionStruct&& x) noexcept { m_my_union = std::move(x.m_my_union); } @@ -7895,12 +7390,8 @@ bool SimpleTypeUnionStruct::operator !=( size_t SimpleTypeUnionStruct::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += SimpleTypeUnion::getMaxCdrSerializedSize(current_alignment); - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return SimpleTypeUnionStruct_max_cdr_typesize; } size_t SimpleTypeUnionStruct::getCdrSerializedSize( @@ -7969,14 +7460,12 @@ SimpleTypeUnion& SimpleTypeUnionStruct::my_union() return m_my_union; } + size_t SimpleTypeUnionStruct::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - return current_align; + static_cast(current_alignment); + return SimpleTypeUnionStruct_max_key_cdr_typesize; } bool SimpleTypeUnionStruct::isKeyDefined() @@ -7988,12 +7477,11 @@ void SimpleTypeUnionStruct::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - } SimpleBadUnionStruct::SimpleBadUnionStruct() { - // m_my_union com.eprosima.idl.parser.typecode.UnionTypeCode@6a79c292 + // SimpleBadUnion m_my_union // Just to register all known types @@ -8011,7 +7499,7 @@ SimpleBadUnionStruct::SimpleBadUnionStruct( } SimpleBadUnionStruct::SimpleBadUnionStruct( - SimpleBadUnionStruct&& x) noexcept + SimpleBadUnionStruct&& x) noexcept { m_my_union = std::move(x.m_my_union); } @@ -8050,12 +7538,8 @@ bool SimpleBadUnionStruct::operator !=( size_t SimpleBadUnionStruct::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += SimpleBadUnion::getMaxCdrSerializedSize(current_alignment); - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return SimpleBadUnionStruct_max_cdr_typesize; } size_t SimpleBadUnionStruct::getCdrSerializedSize( @@ -8124,14 +7608,12 @@ SimpleBadUnion& SimpleBadUnionStruct::my_union() return m_my_union; } + size_t SimpleBadUnionStruct::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - return current_align; + static_cast(current_alignment); + return SimpleBadUnionStruct_max_key_cdr_typesize; } bool SimpleBadUnionStruct::isKeyDefined() @@ -8143,12 +7625,11 @@ void SimpleBadUnionStruct::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - } SimplBadDiscUnionStruct::SimplBadDiscUnionStruct() { - // m_my_union com.eprosima.idl.parser.typecode.UnionTypeCode@25359ed8 + // SimpleBadDiscUnion m_my_union // Just to register all known types @@ -8166,7 +7647,7 @@ SimplBadDiscUnionStruct::SimplBadDiscUnionStruct( } SimplBadDiscUnionStruct::SimplBadDiscUnionStruct( - SimplBadDiscUnionStruct&& x) noexcept + SimplBadDiscUnionStruct&& x) noexcept { m_my_union = std::move(x.m_my_union); } @@ -8205,12 +7686,8 @@ bool SimplBadDiscUnionStruct::operator !=( size_t SimplBadDiscUnionStruct::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += SimpleBadDiscUnion::getMaxCdrSerializedSize(current_alignment); - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return SimplBadDiscUnionStruct_max_cdr_typesize; } size_t SimplBadDiscUnionStruct::getCdrSerializedSize( @@ -8279,14 +7756,12 @@ SimpleBadDiscUnion& SimplBadDiscUnionStruct::my_union() return m_my_union; } + size_t SimplBadDiscUnionStruct::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - return current_align; + static_cast(current_alignment); + return SimplBadDiscUnionStruct_max_key_cdr_typesize; } bool SimplBadDiscUnionStruct::isKeyDefined() @@ -8298,5 +7773,4 @@ void SimplBadDiscUnionStruct::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - } diff --git a/test/xtypes/idl/Types.h b/test/xtypes/idl/Types.h index 317ff658531..ff20ad14cb7 100644 --- a/test/xtypes/idl/Types.h +++ b/test/xtypes/idl/Types.h @@ -164,11 +164,11 @@ class MyEnumStruct /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -223,6 +223,7 @@ class MyEnumStruct private: MyEnum m_my_enum; + }; /*! * @brief This class represents the structure MyBadEnumStruct defined by the user in the IDL file. @@ -305,11 +306,11 @@ class MyBadEnumStruct /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -364,6 +365,7 @@ class MyBadEnumStruct private: MyBadEnum m_my_enum; + }; typedef MyEnum MyAliasEnum; /*! @@ -447,11 +449,11 @@ class MyAliasEnumStruct /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -506,6 +508,7 @@ class MyAliasEnumStruct private: MyAliasEnum m_my_enum; + }; /*! * @brief This class represents the structure BasicStruct defined by the user in the IDL file. @@ -632,11 +635,11 @@ class BasicStruct eProsima_user_DllExport std::string& my_string(); /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -693,6 +696,7 @@ class BasicStruct bool m_my_bool; int32_t m_my_int32; std::string m_my_string; + }; /*! * @brief This class represents the structure BasicNamesStruct defined by the user in the IDL file. @@ -819,11 +823,11 @@ class BasicNamesStruct eProsima_user_DllExport std::string& my_string_name(); /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -880,6 +884,7 @@ class BasicNamesStruct bool m_my_bool_name; int32_t m_my_int32_name; std::string m_my_string_name; + }; /*! * @brief This class represents the structure BasicBadStruct defined by the user in the IDL file. @@ -1006,11 +1011,11 @@ class BasicBadStruct eProsima_user_DllExport std::string& my_string(); /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -1067,6 +1072,7 @@ class BasicBadStruct uint8_t m_my_bool; int32_t m_my_int32; std::string m_my_string; + }; /*! * @brief This class represents the structure BasicWideStruct defined by the user in the IDL file. @@ -1237,11 +1243,11 @@ class BasicWideStruct eProsima_user_DllExport std::string& new_string(); /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -1300,6 +1306,7 @@ class BasicWideStruct std::string m_my_string; int32_t m_new_int32; std::string m_new_string; + }; /*! * @brief This class represents the structure BadBasicWideStruct defined by the user in the IDL file. @@ -1470,11 +1477,11 @@ class BadBasicWideStruct eProsima_user_DllExport std::string& my_string(); /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -1533,6 +1540,7 @@ class BadBasicWideStruct bool m_my_bool; int32_t m_my_int32; std::string m_my_string; + }; /*! * @brief This class represents the structure StringStruct defined by the user in the IDL file. @@ -1621,11 +1629,11 @@ class StringStruct eProsima_user_DllExport std::string& my_string(); /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -1680,6 +1688,7 @@ class StringStruct private: std::string m_my_string; + }; /*! * @brief This class represents the structure LargeStringStruct defined by the user in the IDL file. @@ -1768,11 +1777,11 @@ class LargeStringStruct eProsima_user_DllExport eprosima::fastrtps::fixed_string<41925>& my_large_string(); /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -1827,6 +1836,7 @@ class LargeStringStruct private: eprosima::fastrtps::fixed_string<41925> m_my_large_string; + }; /*! * @brief This class represents the structure WStringStruct defined by the user in the IDL file. @@ -1915,11 +1925,11 @@ class WStringStruct eProsima_user_DllExport std::wstring& my_wstring(); /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -1974,6 +1984,7 @@ class WStringStruct private: std::wstring m_my_wstring; + }; /*! * @brief This class represents the structure LargeWStringStruct defined by the user in the IDL file. @@ -2062,11 +2073,11 @@ class LargeWStringStruct eProsima_user_DllExport std::wstring& my_large_wstring(); /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -2121,6 +2132,7 @@ class LargeWStringStruct private: std::wstring m_my_large_wstring; + }; /*! * @brief This class represents the structure ArrayStruct defined by the user in the IDL file. @@ -2209,11 +2221,11 @@ class ArrayStruct eProsima_user_DllExport std::array& my_array(); /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -2268,6 +2280,7 @@ class ArrayStruct private: std::array m_my_array; + }; /*! * @brief This class represents the structure ArrayStructEqual defined by the user in the IDL file. @@ -2356,11 +2369,11 @@ class ArrayStructEqual eProsima_user_DllExport std::array& my_array_equal(); /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -2415,6 +2428,7 @@ class ArrayStructEqual private: std::array m_my_array_equal; + }; /*! * @brief This class represents the structure ArrayBadStruct defined by the user in the IDL file. @@ -2503,11 +2517,11 @@ class ArrayBadStruct eProsima_user_DllExport std::array& my_array(); /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -2562,6 +2576,7 @@ class ArrayBadStruct private: std::array m_my_array; + }; /*! * @brief This class represents the structure ArrayDimensionsStruct defined by the user in the IDL file. @@ -2650,11 +2665,11 @@ class ArrayDimensionsStruct eProsima_user_DllExport std::array, 2>& my_array(); /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -2709,6 +2724,7 @@ class ArrayDimensionsStruct private: std::array, 2> m_my_array; + }; /*! * @brief This class represents the structure ArraySizeStruct defined by the user in the IDL file. @@ -2797,11 +2813,11 @@ class ArraySizeStruct eProsima_user_DllExport std::array& my_array(); /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -2856,6 +2872,7 @@ class ArraySizeStruct private: std::array m_my_array; + }; /*! * @brief This class represents the structure SequenceStruct defined by the user in the IDL file. @@ -2944,11 +2961,11 @@ class SequenceStruct eProsima_user_DllExport std::vector& my_sequence(); /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -3003,6 +3020,7 @@ class SequenceStruct private: std::vector m_my_sequence; + }; /*! * @brief This class represents the structure SequenceStructEqual defined by the user in the IDL file. @@ -3091,11 +3109,11 @@ class SequenceStructEqual eProsima_user_DllExport std::vector& my_sequence_equal(); /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -3150,6 +3168,7 @@ class SequenceStructEqual private: std::vector m_my_sequence_equal; + }; /*! * @brief This class represents the structure SequenceBadStruct defined by the user in the IDL file. @@ -3238,11 +3257,11 @@ class SequenceBadStruct eProsima_user_DllExport std::vector& my_sequence(); /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -3297,6 +3316,7 @@ class SequenceBadStruct private: std::vector m_my_sequence; + }; /*! * @brief This class represents the structure SequenceBoundsStruct defined by the user in the IDL file. @@ -3385,11 +3405,11 @@ class SequenceBoundsStruct eProsima_user_DllExport std::vector& my_sequence(); /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -3444,6 +3464,7 @@ class SequenceBoundsStruct private: std::vector m_my_sequence; + }; /*! * @brief This class represents the structure SequenceSequenceStruct defined by the user in the IDL file. @@ -3532,11 +3553,11 @@ class SequenceSequenceStruct eProsima_user_DllExport std::vector>& my_sequence_sequence(); /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -3591,6 +3612,7 @@ class SequenceSequenceStruct private: std::vector> m_my_sequence_sequence; + }; /*! * @brief This class represents the structure SequenceSequenceBoundsStruct defined by the user in the IDL file. @@ -3679,11 +3701,11 @@ class SequenceSequenceBoundsStruct eProsima_user_DllExport std::vector>& my_sequence_sequence(); /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -3738,6 +3760,7 @@ class SequenceSequenceBoundsStruct private: std::vector> m_my_sequence_sequence; + }; /*! * @brief This class represents the structure MapStruct defined by the user in the IDL file. @@ -3826,11 +3849,11 @@ class MapStruct eProsima_user_DllExport std::map& my_map(); /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -3885,6 +3908,7 @@ class MapStruct private: std::map m_my_map; + }; /*! * @brief This class represents the structure MapStructEqual defined by the user in the IDL file. @@ -3973,11 +3997,11 @@ class MapStructEqual eProsima_user_DllExport std::map& my_map_equal(); /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -4032,6 +4056,7 @@ class MapStructEqual private: std::map m_my_map_equal; + }; /*! * @brief This class represents the structure MapBadKeyStruct defined by the user in the IDL file. @@ -4120,11 +4145,11 @@ class MapBadKeyStruct eProsima_user_DllExport std::map& my_map(); /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -4179,6 +4204,7 @@ class MapBadKeyStruct private: std::map m_my_map; + }; /*! * @brief This class represents the structure MapBadElemStruct defined by the user in the IDL file. @@ -4267,11 +4293,11 @@ class MapBadElemStruct eProsima_user_DllExport std::map& my_map(); /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -4326,6 +4352,7 @@ class MapBadElemStruct private: std::map m_my_map; + }; /*! * @brief This class represents the structure MapBoundsStruct defined by the user in the IDL file. @@ -4414,11 +4441,11 @@ class MapBoundsStruct eProsima_user_DllExport std::map& my_map(); /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -4473,6 +4500,7 @@ class MapBoundsStruct private: std::map m_my_map; + }; /*! * @brief This class represents the structure MapMapStruct defined by the user in the IDL file. @@ -4561,11 +4589,11 @@ class MapMapStruct eProsima_user_DllExport std::map>& my_map_map(); /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -4620,6 +4648,7 @@ class MapMapStruct private: std::map> m_my_map_map; + }; /*! * @brief This class represents the structure MapMapBoundsStruct defined by the user in the IDL file. @@ -4708,11 +4737,11 @@ class MapMapBoundsStruct eProsima_user_DllExport std::map>& my_map_map(); /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -4767,6 +4796,7 @@ class MapMapBoundsStruct private: std::map> m_my_map_map; + }; /*! * @brief This class represents the union SimpleUnion defined by the user in the IDL file. @@ -4891,15 +4921,6 @@ class SimpleUnion eProsima_user_DllExport int64_t& second(); - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - /*! * @brief This function returns the serialized size of a data depending on the buffer alignment. * @param data Data which is calculated its serialized size. @@ -5058,15 +5079,6 @@ class SimpleUnionNames eProsima_user_DllExport int64_t& second_case(); - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - /*! * @brief This function returns the serialized size of a data depending on the buffer alignment. * @param data Data which is calculated its serialized size. @@ -5225,15 +5237,6 @@ class SimpleTypeUnion eProsima_user_DllExport int64_t& second(); - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - /*! * @brief This function returns the serialized size of a data depending on the buffer alignment. * @param data Data which is calculated its serialized size. @@ -5392,15 +5395,6 @@ class SimpleBadUnion eProsima_user_DllExport int64_t& second(); - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - /*! * @brief This function returns the serialized size of a data depending on the buffer alignment. * @param data Data which is calculated its serialized size. @@ -5559,15 +5553,6 @@ class SimpleBadDiscUnion eProsima_user_DllExport int64_t& second(); - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - /*! * @brief This function returns the serialized size of a data depending on the buffer alignment. * @param data Data which is calculated its serialized size. @@ -5690,11 +5675,11 @@ class SimpleUnionStruct eProsima_user_DllExport SimpleUnion& my_union(); /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -5749,6 +5734,7 @@ class SimpleUnionStruct private: SimpleUnion m_my_union; + }; /*! * @brief This class represents the structure SimpleUnionStructEqual defined by the user in the IDL file. @@ -5837,11 +5823,11 @@ class SimpleUnionStructEqual eProsima_user_DllExport SimpleUnion& my_union_equal(); /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -5896,6 +5882,7 @@ class SimpleUnionStructEqual private: SimpleUnion m_my_union_equal; + }; /*! * @brief This class represents the structure SimpleUnionNamesStruct defined by the user in the IDL file. @@ -5984,11 +5971,11 @@ class SimpleUnionNamesStruct eProsima_user_DllExport SimpleUnionNames& my_union(); /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -6043,6 +6030,7 @@ class SimpleUnionNamesStruct private: SimpleUnionNames m_my_union; + }; /*! * @brief This class represents the structure SimpleTypeUnionStruct defined by the user in the IDL file. @@ -6131,11 +6119,11 @@ class SimpleTypeUnionStruct eProsima_user_DllExport SimpleTypeUnion& my_union(); /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -6190,6 +6178,7 @@ class SimpleTypeUnionStruct private: SimpleTypeUnion m_my_union; + }; /*! * @brief This class represents the structure SimpleBadUnionStruct defined by the user in the IDL file. @@ -6278,11 +6267,11 @@ class SimpleBadUnionStruct eProsima_user_DllExport SimpleBadUnion& my_union(); /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -6337,6 +6326,7 @@ class SimpleBadUnionStruct private: SimpleBadUnion m_my_union; + }; /*! * @brief This class represents the structure SimplBadDiscUnionStruct defined by the user in the IDL file. @@ -6425,11 +6415,11 @@ class SimplBadDiscUnionStruct eProsima_user_DllExport SimpleBadDiscUnion& my_union(); /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -6484,6 +6474,7 @@ class SimplBadDiscUnionStruct private: SimpleBadDiscUnion m_my_union; + }; #endif // _FAST_DDS_GENERATED_TYPES_H_ \ No newline at end of file