diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index 8449a347..691bb4ea 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -26,6 +26,10 @@ jobs: "System32;SysWoW64" -split ";" | Join-Path -Path $env:windir -ChildPath {$_} ` | ls -Include libssl-*.dll | rm + - name: install swig + shell: pwsh + run: choco install swig --allow-downgrade --version=4.0.2.04082020 + - name: Install python build dependencies shell: pwsh run: > @@ -39,8 +43,8 @@ jobs: 'cmake_minimum_required(VERSION 3.5)' + $cr + 'project(dummy VERSION 1.0.0 LANGUAGES CXX)' + $cr + 'find_package (Python3 COMPONENTS Interpreter Development REQUIRED)' + $cr + - 'message(STATUS "cmake detected python=>>>>>${Python3_EXECUTABLE}<<<<<<")' | - Out-File CMakeLists.txt + 'message(STATUS "cmake detected python=>>>>>${Python3_EXECUTABLE}<<<<<<")' | + Out-File CMakeLists.txt (cmake .) *>&1 | % { if($_ -Match "cmake detected python=>>>>>(?.*)<<<<<<") { @@ -59,6 +63,18 @@ jobs: run: | vcs import src --skip-existing --input src/fastdds_python/fastdds_python.repos + - name: Get minimum supported version of CMake + uses: lukka/get-cmake@latest + with: + cmakeVersion: 3.22.6 + - name: Use cmake + run: cmake --version + + - name: Setup ccache + uses: Chocobo1/setup-ccache-action@v1 + with: + windows_compile_environment: msvc + - name: Build workspace shell: pwsh run: | @@ -66,15 +82,16 @@ jobs: $modulepath = "$installpath\Common7\Tools\Microsoft.VisualStudio.DevShell.dll" Import-Module $modulepath Enter-VsDevShell -SetDefaultWindowTitle -InstallPath $installpath ` - -DevCmdArguments '/arch=x64 /host_arch=x64'; - $cargs = @("--event-handlers=console_direct+", ` - "--metas", "./src/fastdds_python/.github/workflows/test.meta") - colcon build --executor parallel $cargs + -StartInPath (pwd) -DevCmdArguments '/arch=x64 /host_arch=x64'; + colcon build --executor parallel --event-handlers console_direct+ desktop_notification- ` + --metas ./src/fastdds_python/.github/workflows/test.meta ` + --cmake-args -DCMAKE_C_COMPILER_LAUNCHER="${{ env.ccache_symlinks_path }}" ` + -DCMAKE_CXX_COMPILER_LAUNCHER="${{ env.ccache_symlinks_path }}" - name: Run tests shell: pwsh run: | - colcon test --packages-select fastdds_python --event-handlers=console_direct+ ` + colcon test --packages-select fastdds_python --event-handlers console_direct+ desktop_notification- ` --return-code-on-test-failure --ctest-args --timeout 60 - name: Upload Logs @@ -85,7 +102,7 @@ jobs: if: always() ubuntu-build-test: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v2 @@ -111,9 +128,20 @@ jobs: run: | vcs import --skip-existing src < src/fastdds_python/fastdds_python.repos + - name: Get minimum supported version of CMake + uses: lukka/get-cmake@latest + with: + cmakeVersion: 3.22.6 + - name: Use cmake + run: cmake --version + + - name: Setup ccache + uses: Chocobo1/setup-ccache-action@v1 + - name: Build workspace run: > - colcon build --event-handlers=console_direct+ --metas ./src/fastdds_python/.github/workflows/test.meta + colcon build --event-handlers=console_direct+ --metas ./src/fastdds_python/.github/workflows/test.meta \ + --cmake-args -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache - name: Run tests run: | diff --git a/fastdds_python.repos b/fastdds_python.repos index fd193227..0e1d3ad9 100644 --- a/fastdds_python.repos +++ b/fastdds_python.repos @@ -6,7 +6,7 @@ repositories: fastcdr: type: git url: https://github.com/eProsima/Fast-CDR.git - version: 1.1.x + version: master fastdds: type: git url: https://github.com/eProsima/Fast-DDS.git diff --git a/fastdds_python/CMakeLists.txt b/fastdds_python/CMakeLists.txt index b4fb1c1e..21c64500 100644 --- a/fastdds_python/CMakeLists.txt +++ b/fastdds_python/CMakeLists.txt @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -cmake_minimum_required(VERSION 3.15) +cmake_minimum_required(VERSION 3.22) # SWIG: use standard target name. if(POLICY CMP0078) @@ -36,7 +36,8 @@ set(CMAKE_SWIG_FLAGS "") find_package (Python3 COMPONENTS Interpreter Development REQUIRED) -find_package(fastrtps REQUIRED) +find_package(fastcdr 2 REQUIRED) +find_package(fastrtps 2.12 REQUIRED) ############################################################################### # Project subdirectories diff --git a/fastdds_python/src/swig/CMakeLists.txt b/fastdds_python/src/swig/CMakeLists.txt index 078d07c5..c30d7820 100644 --- a/fastdds_python/src/swig/CMakeLists.txt +++ b/fastdds_python/src/swig/CMakeLists.txt @@ -39,7 +39,7 @@ if (BUILD_DOCUMENTATION) set(CMAKE_SWIG_FLAGS "-doxygen") endif (BUILD_DOCUMENTATION) -SWIG_ADD_LIBRARY(${PROJECT_NAME} +swig_add_library(${PROJECT_NAME} TYPE SHARED LANGUAGE python SOURCES ${${PROJECT_NAME}_FILES} @@ -49,8 +49,13 @@ if(UNIX AND CMAKE_SIZEOF_VOID_P EQUAL 8) set_property(TARGET ${PROJECT_NAME} PROPERTY SWIG_COMPILE_DEFINITIONS SWIGWORDSIZE64) endif() -SWIG_LINK_LIBRARIES(${PROJECT_NAME} +if(MSVC OR MSVC_IDE) + target_compile_options(${PROJECT_NAME} PRIVATE /bigobj) +endif() + +target_link_libraries(${PROJECT_NAME} Python3::Module + fastcdr fastrtps ) diff --git a/fastdds_python/test/CMakeLists.txt b/fastdds_python/test/CMakeLists.txt index 86eae1ce..4213aa82 100644 --- a/fastdds_python/test/CMakeLists.txt +++ b/fastdds_python/test/CMakeLists.txt @@ -1,3 +1,17 @@ +# Copyright 2022 Proyectos y Sistemas de Mantenimiento SL (eProsima). +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + # Compile types add_subdirectory(types) diff --git a/fastdds_python/test/types/CMakeLists.txt b/fastdds_python/test/types/CMakeLists.txt index dc191c85..65c3460c 100644 --- a/fastdds_python/test/types/CMakeLists.txt +++ b/fastdds_python/test/types/CMakeLists.txt @@ -1,5 +1,18 @@ - -cmake_minimum_required(VERSION 3.16.3) +# Copyright 2022 Proyectos y Sistemas de Mantenimiento SL (eProsima). +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +cmake_minimum_required(VERSION 3.22) # SWIG: use standard target name. if(POLICY CMP0078) @@ -22,8 +35,8 @@ message(STATUS "Configuring python wrapper for types in test_complete...") project(test_complete) -find_package(fastcdr REQUIRED) -find_package(fastrtps REQUIRED) +find_package(fastcdr 2 REQUIRED) +find_package(fastrtps 2.12 REQUIRED) set(${PROJECT_NAME}_FILES @@ -74,6 +87,8 @@ include_directories( ${PROJECT_SOURCE_DIR} ) +set_property(SOURCE ${PROJECT_NAME}.i PROPERTY OUTPUT_DIR "${CMAKE_CURRENT_BINARY_DIR}/") + SWIG_ADD_LIBRARY(${${PROJECT_NAME}_MODULE} TYPE SHARED LANGUAGE python @@ -83,12 +98,17 @@ if(UNIX AND CMAKE_SIZEOF_VOID_P EQUAL 8) set_property(TARGET ${${PROJECT_NAME}_MODULE} PROPERTY SWIG_COMPILE_DEFINITIONS SWIGWORDSIZE64) endif() -SWIG_LINK_LIBRARIES(${${PROJECT_NAME}_MODULE} +target_link_libraries(${${PROJECT_NAME}_MODULE} Python3::Module fastrtps ${PROJECT_NAME} ) +set_target_properties(${${PROJECT_NAME}_MODULE} + PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/" + ) + + # Find the installation path execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "from distutils import sysconfig; print(sysconfig.get_python_lib(plat_specific=True, prefix='${CMAKE_INSTALL_PREFIX}'))" OUTPUT_VARIABLE _ABS_PYTHON_MODULE_PATH @@ -107,7 +127,7 @@ install(TARGETS ${PROJECT_NAME} LIBRARY DESTINATION lib/ ARCHIVE DESTINATION lib/ ) -install(TARGETS ${${PROJECT_NAME}_MODULE} DESTINATION ${PYTHON_MODULE_PATH}) +install(TARGETS ${${PROJECT_NAME}_MODULE} DESTINATION ${PYTHON_MODULE_PATH}/) get_property(support_files TARGET ${${PROJECT_NAME}_MODULE} PROPERTY SWIG_SUPPORT_FILES) -install(FILES ${support_files} DESTINATION ${PYTHON_MODULE_PATH}) +install(FILES ${support_files} DESTINATION ${PYTHON_MODULE_PATH}/) diff --git a/fastdds_python/test/types/test_complete.cxx b/fastdds_python/test/types/test_complete.cxx index bf8d0d5a..1de81620 100644 --- a/fastdds_python/test/types/test_complete.cxx +++ b/fastdds_python/test/types/test_complete.cxx @@ -14,9 +14,9 @@ /*! * @file test_complete.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen. */ #ifdef _WIN32 @@ -29,73 +29,20 @@ char dummy; #include "test_complete.h" #include + #include using namespace eprosima::fastcdr::exception; #include -#define CompleteTestType_max_cdr_typesize 40872ULL; -#define StructType_max_cdr_typesize 320ULL; - - -#define KeyedCompleteTestType_max_cdr_typesize 40880ULL; -#define CompleteTestType_max_key_cdr_typesize 0ULL; -#define StructType_max_key_cdr_typesize 0ULL; - - -#define KeyedCompleteTestType_max_key_cdr_typesize 4ULL; - - StructType::StructType() { - // char m_char_field - m_char_field = 0; - // octet m_uint8_field - m_uint8_field = 0; - // short m_int16_field - m_int16_field = 0; - // unsigned short m_uint16_field - m_uint16_field = 0; - // long m_int32_field - m_int32_field = 0; - // unsigned long m_uint32_field - m_uint32_field = 0; - // long long m_int64_field - m_int64_field = 0; - // unsigned long long m_uint64_field - m_uint64_field = 0; - // float m_float_field - m_float_field = 0.0; - // double m_double_field - m_double_field = 0.0; - // boolean m_bool_field - m_bool_field = false; - // string m_string_field - m_string_field =""; - // Color m_enum_field - m_enum_field = ::RED; - // Material m_enum2_field - m_enum2_field = ::WOOD; } StructType::~StructType() { - - - - - - - - - - - - - - } StructType::StructType( @@ -118,7 +65,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; @@ -183,8 +130,20 @@ StructType& StructType::operator =( bool StructType::operator ==( const StructType& x) const { - - return (m_char_field == x.m_char_field && m_uint8_field == x.m_uint8_field && m_int16_field == x.m_int16_field && m_uint16_field == x.m_uint16_field && m_int32_field == x.m_int32_field && m_uint32_field == x.m_uint32_field && m_int64_field == x.m_int64_field && m_uint64_field == x.m_uint64_field && m_float_field == x.m_float_field && m_double_field == x.m_double_field && m_bool_field == x.m_bool_field && m_string_field == x.m_string_field && m_enum_field == x.m_enum_field && m_enum2_field == x.m_enum2_field); + return (m_char_field == x.m_char_field && + m_uint8_field == x.m_uint8_field && + m_int16_field == x.m_int16_field && + m_uint16_field == x.m_uint16_field && + m_int32_field == x.m_int32_field && + m_uint32_field == x.m_uint32_field && + m_int64_field == x.m_int64_field && + m_uint64_field == x.m_uint64_field && + m_float_field == x.m_float_field && + m_double_field == x.m_double_field && + m_bool_field == x.m_bool_field && + m_string_field == x.m_string_field && + m_enum_field == x.m_enum_field && + m_enum2_field == x.m_enum2_field); } bool StructType::operator !=( @@ -193,117 +152,6 @@ bool StructType::operator !=( return !(*this == x); } -size_t StructType::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return StructType_max_cdr_typesize; -} - -size_t StructType::getCdrSerializedSize( - const StructType& 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); - - - 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 += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - 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); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - - return current_alignment - initial_alignment; -} - -void StructType::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_char_field; - scdr << m_uint8_field; - scdr << m_int16_field; - scdr << m_uint16_field; - scdr << m_int32_field; - scdr << m_uint32_field; - scdr << m_int64_field; - scdr << m_uint64_field; - scdr << m_float_field; - scdr << m_double_field; - scdr << m_bool_field; - scdr << m_string_field.c_str(); - scdr << (uint32_t)m_enum_field; - scdr << (uint32_t)m_enum2_field; - -} - -void StructType::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_char_field; - dcdr >> m_uint8_field; - dcdr >> m_int16_field; - dcdr >> m_uint16_field; - dcdr >> m_int32_field; - dcdr >> m_uint32_field; - dcdr >> m_int64_field; - dcdr >> m_uint64_field; - dcdr >> m_float_field; - dcdr >> m_double_field; - dcdr >> m_bool_field; - dcdr >> m_string_field; - { - uint32_t enum_value = 0; - dcdr >> enum_value; - m_enum_field = (Color)enum_value; - } - - { - uint32_t enum_value = 0; - dcdr >> enum_value; - m_enum2_field = (Material)enum_value; - } - -} - /*! * @brief This function sets a value in member char_field * @param _char_field New value for member char_field @@ -332,6 +180,7 @@ char& StructType::char_field() return m_char_field; } + /*! * @brief This function sets a value in member uint8_field * @param _uint8_field New value for member uint8_field @@ -360,6 +209,7 @@ uint8_t& StructType::uint8_field() return m_uint8_field; } + /*! * @brief This function sets a value in member int16_field * @param _int16_field New value for member int16_field @@ -388,6 +238,7 @@ int16_t& StructType::int16_field() return m_int16_field; } + /*! * @brief This function sets a value in member uint16_field * @param _uint16_field New value for member uint16_field @@ -416,6 +267,7 @@ uint16_t& StructType::uint16_field() return m_uint16_field; } + /*! * @brief This function sets a value in member int32_field * @param _int32_field New value for member int32_field @@ -444,6 +296,7 @@ int32_t& StructType::int32_field() return m_int32_field; } + /*! * @brief This function sets a value in member uint32_field * @param _uint32_field New value for member uint32_field @@ -472,6 +325,7 @@ uint32_t& StructType::uint32_field() return m_uint32_field; } + /*! * @brief This function sets a value in member int64_field * @param _int64_field New value for member int64_field @@ -500,6 +354,7 @@ int64_t& StructType::int64_field() return m_int64_field; } + /*! * @brief This function sets a value in member uint64_field * @param _uint64_field New value for member uint64_field @@ -528,6 +383,7 @@ uint64_t& StructType::uint64_field() return m_uint64_field; } + /*! * @brief This function sets a value in member float_field * @param _float_field New value for member float_field @@ -556,6 +412,7 @@ float& StructType::float_field() return m_float_field; } + /*! * @brief This function sets a value in member double_field * @param _double_field New value for member double_field @@ -584,6 +441,7 @@ double& StructType::double_field() return m_double_field; } + /*! * @brief This function sets a value in member bool_field * @param _bool_field New value for member bool_field @@ -612,6 +470,7 @@ bool& StructType::bool_field() return m_bool_field; } + /*! * @brief This function copies the value in member string_field * @param _string_field New value to be copied in member string_field @@ -649,6 +508,8 @@ std::string& StructType::string_field() { return m_string_field; } + + /*! * @brief This function sets a value in member enum_field * @param _enum_field New value for member enum_field @@ -677,6 +538,7 @@ Color& StructType::enum_field() return m_enum_field; } + /*! * @brief This function sets a value in member enum2_field * @param _enum2_field New value for member enum2_field @@ -707,205 +569,14 @@ Material& StructType::enum2_field() -size_t StructType::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return StructType_max_key_cdr_typesize; -} - -bool StructType::isKeyDefined() -{ - return false; -} - -void StructType::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - - - CompleteTestType::CompleteTestType() { - // char m_char_field - m_char_field = 0; - // octet m_uint8_field - m_uint8_field = 0; - // short m_int16_field - m_int16_field = 0; - // unsigned short m_uint16_field - m_uint16_field = 0; - // long m_int32_field - m_int32_field = 0; - // unsigned long m_uint32_field - m_uint32_field = 0; - // long long m_int64_field - m_int64_field = 0; - // unsigned long long m_uint64_field - m_uint64_field = 0; - // float m_float_field - m_float_field = 0.0; - // double m_double_field - m_double_field = 0.0; - // boolean m_bool_field - m_bool_field = false; - // string m_string_field - m_string_field =""; - // Color m_enum_field - m_enum_field = ::RED; - // Material m_enum2_field - m_enum2_field = ::WOOD; - // StructType m_struct_field - - // 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); - // boolean m_array_bool_field - memset(&m_array_bool_field, 0, (3) * 1); - // 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 - - // sequence m_bounded_sequence_char_field - - // sequence m_bounded_sequence_uint8_field - - // sequence m_bounded_sequence_int16_field - - // sequence m_bounded_sequence_uint16_field - - // sequence m_bounded_sequence_int32_field - - // sequence m_bounded_sequence_uint32_field - - // sequence m_bounded_sequence_int64_field - - // sequence m_bounded_sequence_uint64_field - - // sequence m_bounded_sequence_float_field - - // sequence m_bounded_sequence_double_field - - // sequence m_bounded_sequence_bool_field - - // sequence m_bounded_sequence_enum_field - - // sequence m_bounded_sequence_enum2_field - - // sequence m_bounded_sequence_struct_field - - // sequence m_unbounded_sequence_char_field - - // sequence m_unbounded_sequence_uint8_field - - // sequence m_unbounded_sequence_int16_field - - // sequence m_unbounded_sequence_uint16_field - - // sequence m_unbounded_sequence_int32_field - - // sequence m_unbounded_sequence_uint32_field - - // sequence m_unbounded_sequence_int64_field - - // sequence m_unbounded_sequence_uint64_field - - // sequence m_unbounded_sequence_float_field - - // sequence m_unbounded_sequence_double_field - - // sequence m_unbounded_sequence_bool_field - - // sequence m_unbounded_sequence_enum_field - - // sequence m_unbounded_sequence_enum2_field - - // sequence m_unbounded_sequence_struct_field - } CompleteTestType::~CompleteTestType() { - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - } CompleteTestType::CompleteTestType( @@ -971,7 +642,7 @@ CompleteTestType::CompleteTestType( } CompleteTestType::CompleteTestType( - CompleteTestType&& x) noexcept + CompleteTestType&& x) noexcept { m_char_field = x.m_char_field; m_uint8_field = x.m_uint8_field; @@ -1165,8 +836,63 @@ CompleteTestType& CompleteTestType::operator =( bool CompleteTestType::operator ==( const CompleteTestType& x) const { - - return (m_char_field == x.m_char_field && m_uint8_field == x.m_uint8_field && m_int16_field == x.m_int16_field && m_uint16_field == x.m_uint16_field && m_int32_field == x.m_int32_field && m_uint32_field == x.m_uint32_field && m_int64_field == x.m_int64_field && m_uint64_field == x.m_uint64_field && m_float_field == x.m_float_field && m_double_field == x.m_double_field && m_bool_field == x.m_bool_field && m_string_field == x.m_string_field && m_enum_field == x.m_enum_field && m_enum2_field == x.m_enum2_field && m_struct_field == x.m_struct_field && m_array_char_field == x.m_array_char_field && m_array_uint8_field == x.m_array_uint8_field && m_array_int16_field == x.m_array_int16_field && m_array_uint16_field == x.m_array_uint16_field && m_array_int32_field == x.m_array_int32_field && m_array_uint32_field == x.m_array_uint32_field && m_array_int64_field == x.m_array_int64_field && m_array_uint64_field == x.m_array_uint64_field && m_array_float_field == x.m_array_float_field && m_array_double_field == x.m_array_double_field && m_array_bool_field == x.m_array_bool_field && m_array_enum_field == x.m_array_enum_field && m_array_enum2_field == x.m_array_enum2_field && m_array_struct_field == x.m_array_struct_field && m_bounded_sequence_char_field == x.m_bounded_sequence_char_field && m_bounded_sequence_uint8_field == x.m_bounded_sequence_uint8_field && m_bounded_sequence_int16_field == x.m_bounded_sequence_int16_field && m_bounded_sequence_uint16_field == x.m_bounded_sequence_uint16_field && m_bounded_sequence_int32_field == x.m_bounded_sequence_int32_field && m_bounded_sequence_uint32_field == x.m_bounded_sequence_uint32_field && m_bounded_sequence_int64_field == x.m_bounded_sequence_int64_field && m_bounded_sequence_uint64_field == x.m_bounded_sequence_uint64_field && m_bounded_sequence_float_field == x.m_bounded_sequence_float_field && m_bounded_sequence_double_field == x.m_bounded_sequence_double_field && m_bounded_sequence_bool_field == x.m_bounded_sequence_bool_field && m_bounded_sequence_enum_field == x.m_bounded_sequence_enum_field && m_bounded_sequence_enum2_field == x.m_bounded_sequence_enum2_field && m_bounded_sequence_struct_field == x.m_bounded_sequence_struct_field && m_unbounded_sequence_char_field == x.m_unbounded_sequence_char_field && m_unbounded_sequence_uint8_field == x.m_unbounded_sequence_uint8_field && m_unbounded_sequence_int16_field == x.m_unbounded_sequence_int16_field && m_unbounded_sequence_uint16_field == x.m_unbounded_sequence_uint16_field && m_unbounded_sequence_int32_field == x.m_unbounded_sequence_int32_field && m_unbounded_sequence_uint32_field == x.m_unbounded_sequence_uint32_field && m_unbounded_sequence_int64_field == x.m_unbounded_sequence_int64_field && m_unbounded_sequence_uint64_field == x.m_unbounded_sequence_uint64_field && m_unbounded_sequence_float_field == x.m_unbounded_sequence_float_field && m_unbounded_sequence_double_field == x.m_unbounded_sequence_double_field && m_unbounded_sequence_bool_field == x.m_unbounded_sequence_bool_field && m_unbounded_sequence_enum_field == x.m_unbounded_sequence_enum_field && m_unbounded_sequence_enum2_field == x.m_unbounded_sequence_enum2_field && m_unbounded_sequence_struct_field == x.m_unbounded_sequence_struct_field); + return (m_char_field == x.m_char_field && + m_uint8_field == x.m_uint8_field && + m_int16_field == x.m_int16_field && + m_uint16_field == x.m_uint16_field && + m_int32_field == x.m_int32_field && + m_uint32_field == x.m_uint32_field && + m_int64_field == x.m_int64_field && + m_uint64_field == x.m_uint64_field && + m_float_field == x.m_float_field && + m_double_field == x.m_double_field && + m_bool_field == x.m_bool_field && + m_string_field == x.m_string_field && + m_enum_field == x.m_enum_field && + m_enum2_field == x.m_enum2_field && + m_struct_field == x.m_struct_field && + m_array_char_field == x.m_array_char_field && + m_array_uint8_field == x.m_array_uint8_field && + m_array_int16_field == x.m_array_int16_field && + m_array_uint16_field == x.m_array_uint16_field && + m_array_int32_field == x.m_array_int32_field && + m_array_uint32_field == x.m_array_uint32_field && + m_array_int64_field == x.m_array_int64_field && + m_array_uint64_field == x.m_array_uint64_field && + m_array_float_field == x.m_array_float_field && + m_array_double_field == x.m_array_double_field && + m_array_bool_field == x.m_array_bool_field && + m_array_enum_field == x.m_array_enum_field && + m_array_enum2_field == x.m_array_enum2_field && + m_array_struct_field == x.m_array_struct_field && + m_bounded_sequence_char_field == x.m_bounded_sequence_char_field && + m_bounded_sequence_uint8_field == x.m_bounded_sequence_uint8_field && + m_bounded_sequence_int16_field == x.m_bounded_sequence_int16_field && + m_bounded_sequence_uint16_field == x.m_bounded_sequence_uint16_field && + m_bounded_sequence_int32_field == x.m_bounded_sequence_int32_field && + m_bounded_sequence_uint32_field == x.m_bounded_sequence_uint32_field && + m_bounded_sequence_int64_field == x.m_bounded_sequence_int64_field && + m_bounded_sequence_uint64_field == x.m_bounded_sequence_uint64_field && + m_bounded_sequence_float_field == x.m_bounded_sequence_float_field && + m_bounded_sequence_double_field == x.m_bounded_sequence_double_field && + m_bounded_sequence_bool_field == x.m_bounded_sequence_bool_field && + m_bounded_sequence_enum_field == x.m_bounded_sequence_enum_field && + m_bounded_sequence_enum2_field == x.m_bounded_sequence_enum2_field && + m_bounded_sequence_struct_field == x.m_bounded_sequence_struct_field && + m_unbounded_sequence_char_field == x.m_unbounded_sequence_char_field && + m_unbounded_sequence_uint8_field == x.m_unbounded_sequence_uint8_field && + m_unbounded_sequence_int16_field == x.m_unbounded_sequence_int16_field && + m_unbounded_sequence_uint16_field == x.m_unbounded_sequence_uint16_field && + m_unbounded_sequence_int32_field == x.m_unbounded_sequence_int32_field && + m_unbounded_sequence_uint32_field == x.m_unbounded_sequence_uint32_field && + m_unbounded_sequence_int64_field == x.m_unbounded_sequence_int64_field && + m_unbounded_sequence_uint64_field == x.m_unbounded_sequence_uint64_field && + m_unbounded_sequence_float_field == x.m_unbounded_sequence_float_field && + m_unbounded_sequence_double_field == x.m_unbounded_sequence_double_field && + m_unbounded_sequence_bool_field == x.m_unbounded_sequence_bool_field && + m_unbounded_sequence_enum_field == x.m_unbounded_sequence_enum_field && + m_unbounded_sequence_enum2_field == x.m_unbounded_sequence_enum2_field && + m_unbounded_sequence_struct_field == x.m_unbounded_sequence_struct_field); } bool CompleteTestType::operator !=( @@ -1175,704 +901,168 @@ bool CompleteTestType::operator !=( return !(*this == x); } -size_t CompleteTestType::getMaxCdrSerializedSize( - size_t current_alignment) +/*! + * @brief This function sets a value in member char_field + * @param _char_field New value for member char_field + */ +void CompleteTestType::char_field( + char _char_field) { - static_cast(current_alignment); - return CompleteTestType_max_cdr_typesize; + m_char_field = _char_field; } -size_t CompleteTestType::getCdrSerializedSize( - const CompleteTestType& data, - size_t current_alignment) +/*! + * @brief This function returns the value of member char_field + * @return Value of member char_field + */ +char CompleteTestType::char_field() const { - (void)data; - size_t initial_alignment = current_alignment; + return m_char_field; +} +/*! + * @brief This function returns a reference to member char_field + * @return Reference to member char_field + */ +char& CompleteTestType::char_field() +{ + return m_char_field; +} - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); +/*! + * @brief This function sets a value in member uint8_field + * @param _uint8_field New value for member uint8_field + */ +void CompleteTestType::uint8_field( + uint8_t _uint8_field) +{ + m_uint8_field = _uint8_field; +} - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); +/*! + * @brief This function returns the value of member uint8_field + * @return Value of member uint8_field + */ +uint8_t CompleteTestType::uint8_field() const +{ + return m_uint8_field; +} +/*! + * @brief This function returns a reference to member uint8_field + * @return Reference to member uint8_field + */ +uint8_t& CompleteTestType::uint8_field() +{ + return m_uint8_field; +} - current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); +/*! + * @brief This function sets a value in member int16_field + * @param _int16_field New value for member int16_field + */ +void CompleteTestType::int16_field( + int16_t _int16_field) +{ + m_int16_field = _int16_field; +} - current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); +/*! + * @brief This function returns the value of member int16_field + * @return Value of member int16_field + */ +int16_t CompleteTestType::int16_field() const +{ + return m_int16_field; +} +/*! + * @brief This function returns a reference to member int16_field + * @return Reference to member int16_field + */ +int16_t& CompleteTestType::int16_field() +{ + return m_int16_field; +} - 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 += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - 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); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += StructType::getCdrSerializedSize(data.struct_field(), current_alignment); - current_alignment += ((3) * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - current_alignment += ((3) * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - current_alignment += ((3) * 2) + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); - - current_alignment += ((3) * 2) + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); - - current_alignment += ((3) * 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 += ((3) * 8) + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - current_alignment += ((3) * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - current_alignment += ((3) * 8) + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - current_alignment += ((3) * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - 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) - { - current_alignment += StructType::getCdrSerializedSize(data.array_struct_field().at(a), current_alignment); - } - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - if (data.bounded_sequence_char_field().size() > 0) - { - current_alignment += (data.bounded_sequence_char_field().size() * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - } - - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - if (data.bounded_sequence_uint8_field().size() > 0) - { - current_alignment += (data.bounded_sequence_uint8_field().size() * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - } - - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - if (data.bounded_sequence_int16_field().size() > 0) - { - current_alignment += (data.bounded_sequence_int16_field().size() * 2) + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); - } - - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - if (data.bounded_sequence_uint16_field().size() > 0) - { - current_alignment += (data.bounded_sequence_uint16_field().size() * 2) + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); - } - - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - if (data.bounded_sequence_int32_field().size() > 0) - { - current_alignment += (data.bounded_sequence_int32_field().size() * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - } - - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - if (data.bounded_sequence_uint32_field().size() > 0) - { - current_alignment += (data.bounded_sequence_uint32_field().size() * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - } - - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - if (data.bounded_sequence_int64_field().size() > 0) - { - current_alignment += (data.bounded_sequence_int64_field().size() * 8) + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - } - - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - if (data.bounded_sequence_uint64_field().size() > 0) - { - current_alignment += (data.bounded_sequence_uint64_field().size() * 8) + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - } - - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - if (data.bounded_sequence_float_field().size() > 0) - { - current_alignment += (data.bounded_sequence_float_field().size() * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - } - - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - if (data.bounded_sequence_double_field().size() > 0) - { - current_alignment += (data.bounded_sequence_double_field().size() * 8) + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - } - - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - if (data.bounded_sequence_bool_field().size() > 0) - { - current_alignment += (data.bounded_sequence_bool_field().size() * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - } - - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - if (data.bounded_sequence_enum_field().size() > 0) - { - current_alignment += (data.bounded_sequence_enum_field().size() * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - } - - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - if (data.bounded_sequence_enum2_field().size() > 0) - { - current_alignment += (data.bounded_sequence_enum2_field().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 < data.bounded_sequence_struct_field().size(); ++a) - { - current_alignment += StructType::getCdrSerializedSize(data.bounded_sequence_struct_field().at(a), current_alignment);} - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - if (data.unbounded_sequence_char_field().size() > 0) - { - current_alignment += (data.unbounded_sequence_char_field().size() * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - } - - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - if (data.unbounded_sequence_uint8_field().size() > 0) - { - current_alignment += (data.unbounded_sequence_uint8_field().size() * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - } - - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - if (data.unbounded_sequence_int16_field().size() > 0) - { - current_alignment += (data.unbounded_sequence_int16_field().size() * 2) + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); - } - - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - if (data.unbounded_sequence_uint16_field().size() > 0) - { - current_alignment += (data.unbounded_sequence_uint16_field().size() * 2) + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); - } - - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - if (data.unbounded_sequence_int32_field().size() > 0) - { - current_alignment += (data.unbounded_sequence_int32_field().size() * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - } - - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - if (data.unbounded_sequence_uint32_field().size() > 0) - { - current_alignment += (data.unbounded_sequence_uint32_field().size() * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - } - - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - if (data.unbounded_sequence_int64_field().size() > 0) - { - current_alignment += (data.unbounded_sequence_int64_field().size() * 8) + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - } - - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - if (data.unbounded_sequence_uint64_field().size() > 0) - { - current_alignment += (data.unbounded_sequence_uint64_field().size() * 8) + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - } - - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - if (data.unbounded_sequence_float_field().size() > 0) - { - current_alignment += (data.unbounded_sequence_float_field().size() * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - } - - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - if (data.unbounded_sequence_double_field().size() > 0) - { - current_alignment += (data.unbounded_sequence_double_field().size() * 8) + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - } - - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - if (data.unbounded_sequence_bool_field().size() > 0) - { - current_alignment += (data.unbounded_sequence_bool_field().size() * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - } - - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - if (data.unbounded_sequence_enum_field().size() > 0) - { - current_alignment += (data.unbounded_sequence_enum_field().size() * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - } - - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - if (data.unbounded_sequence_enum2_field().size() > 0) - { - current_alignment += (data.unbounded_sequence_enum2_field().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 < data.unbounded_sequence_struct_field().size(); ++a) - { - current_alignment += StructType::getCdrSerializedSize(data.unbounded_sequence_struct_field().at(a), current_alignment);} - - - return current_alignment - initial_alignment; -} - -void CompleteTestType::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_char_field; - scdr << m_uint8_field; - scdr << m_int16_field; - scdr << m_uint16_field; - scdr << m_int32_field; - scdr << m_uint32_field; - scdr << m_int64_field; - scdr << m_uint64_field; - scdr << m_float_field; - scdr << m_double_field; - scdr << m_bool_field; - scdr << m_string_field.c_str(); - scdr << (uint32_t)m_enum_field; - scdr << (uint32_t)m_enum2_field; - scdr << m_struct_field; - scdr << m_array_char_field; - - scdr << m_array_uint8_field; - - scdr << m_array_int16_field; - - scdr << m_array_uint16_field; - - scdr << m_array_int32_field; - - scdr << m_array_uint32_field; - - scdr << m_array_int64_field; - - scdr << m_array_uint64_field; - - scdr << m_array_float_field; - - scdr << m_array_double_field; - - scdr << m_array_bool_field; - - scdr.serializeArray(reinterpret_cast(m_array_enum_field.data()), m_array_enum_field.size()); - - - scdr.serializeArray(reinterpret_cast(m_array_enum2_field.data()), m_array_enum2_field.size()); - - - scdr << m_array_struct_field; - - scdr << m_bounded_sequence_char_field; - scdr << m_bounded_sequence_uint8_field; - scdr << m_bounded_sequence_int16_field; - scdr << m_bounded_sequence_uint16_field; - scdr << m_bounded_sequence_int32_field; - scdr << m_bounded_sequence_uint32_field; - scdr << m_bounded_sequence_int64_field; - scdr << m_bounded_sequence_uint64_field; - scdr << m_bounded_sequence_float_field; - scdr << m_bounded_sequence_double_field; - scdr << m_bounded_sequence_bool_field; - scdr << static_cast(m_bounded_sequence_enum_field.size()); - scdr.serializeArray(reinterpret_cast(m_bounded_sequence_enum_field.data()), m_bounded_sequence_enum_field.size()); - - scdr << static_cast(m_bounded_sequence_enum2_field.size()); - scdr.serializeArray(reinterpret_cast(m_bounded_sequence_enum2_field.data()), m_bounded_sequence_enum2_field.size()); - - scdr << m_bounded_sequence_struct_field; - scdr << m_unbounded_sequence_char_field; - scdr << m_unbounded_sequence_uint8_field; - scdr << m_unbounded_sequence_int16_field; - scdr << m_unbounded_sequence_uint16_field; - scdr << m_unbounded_sequence_int32_field; - scdr << m_unbounded_sequence_uint32_field; - scdr << m_unbounded_sequence_int64_field; - scdr << m_unbounded_sequence_uint64_field; - scdr << m_unbounded_sequence_float_field; - scdr << m_unbounded_sequence_double_field; - scdr << m_unbounded_sequence_bool_field; - scdr << static_cast(m_unbounded_sequence_enum_field.size()); - scdr.serializeArray(reinterpret_cast(m_unbounded_sequence_enum_field.data()), m_unbounded_sequence_enum_field.size()); - - scdr << static_cast(m_unbounded_sequence_enum2_field.size()); - scdr.serializeArray(reinterpret_cast(m_unbounded_sequence_enum2_field.data()), m_unbounded_sequence_enum2_field.size()); - - scdr << m_unbounded_sequence_struct_field; - -} - -void CompleteTestType::deserialize( - eprosima::fastcdr::Cdr& dcdr) +/*! + * @brief This function sets a value in member uint16_field + * @param _uint16_field New value for member uint16_field + */ +void CompleteTestType::uint16_field( + uint16_t _uint16_field) { - - dcdr >> m_char_field; - dcdr >> m_uint8_field; - dcdr >> m_int16_field; - dcdr >> m_uint16_field; - dcdr >> m_int32_field; - dcdr >> m_uint32_field; - dcdr >> m_int64_field; - dcdr >> m_uint64_field; - dcdr >> m_float_field; - dcdr >> m_double_field; - dcdr >> m_bool_field; - dcdr >> m_string_field; - { - uint32_t enum_value = 0; - dcdr >> enum_value; - m_enum_field = (Color)enum_value; - } - - { - uint32_t enum_value = 0; - dcdr >> enum_value; - m_enum2_field = (Material)enum_value; - } - - dcdr >> m_struct_field; - dcdr >> m_array_char_field; - - dcdr >> m_array_uint8_field; - - dcdr >> m_array_int16_field; - - dcdr >> m_array_uint16_field; - - dcdr >> m_array_int32_field; - - dcdr >> m_array_uint32_field; - - dcdr >> m_array_int64_field; - - dcdr >> m_array_uint64_field; - - dcdr >> m_array_float_field; - - dcdr >> m_array_double_field; - - dcdr >> m_array_bool_field; - - dcdr.deserializeArray(reinterpret_cast(m_array_enum_field.data()), m_array_enum_field.size()); - - - dcdr.deserializeArray(reinterpret_cast(m_array_enum2_field.data()), m_array_enum2_field.size()); - - - dcdr >> m_array_struct_field; - - dcdr >> m_bounded_sequence_char_field; - dcdr >> m_bounded_sequence_uint8_field; - dcdr >> m_bounded_sequence_int16_field; - dcdr >> m_bounded_sequence_uint16_field; - dcdr >> m_bounded_sequence_int32_field; - dcdr >> m_bounded_sequence_uint32_field; - dcdr >> m_bounded_sequence_int64_field; - dcdr >> m_bounded_sequence_uint64_field; - dcdr >> m_bounded_sequence_float_field; - dcdr >> m_bounded_sequence_double_field; - dcdr >> m_bounded_sequence_bool_field; - { - uint32_t seq_length = 0; - dcdr >> seq_length; - m_bounded_sequence_enum_field.resize(seq_length); - dcdr.deserializeArray(reinterpret_cast(m_bounded_sequence_enum_field.data()), seq_length); - } - - { - uint32_t seq_length = 0; - dcdr >> seq_length; - m_bounded_sequence_enum2_field.resize(seq_length); - dcdr.deserializeArray(reinterpret_cast(m_bounded_sequence_enum2_field.data()), seq_length); - } - - dcdr >> m_bounded_sequence_struct_field; - dcdr >> m_unbounded_sequence_char_field; - dcdr >> m_unbounded_sequence_uint8_field; - dcdr >> m_unbounded_sequence_int16_field; - dcdr >> m_unbounded_sequence_uint16_field; - dcdr >> m_unbounded_sequence_int32_field; - dcdr >> m_unbounded_sequence_uint32_field; - dcdr >> m_unbounded_sequence_int64_field; - dcdr >> m_unbounded_sequence_uint64_field; - dcdr >> m_unbounded_sequence_float_field; - dcdr >> m_unbounded_sequence_double_field; - dcdr >> m_unbounded_sequence_bool_field; - { - uint32_t seq_length = 0; - dcdr >> seq_length; - m_unbounded_sequence_enum_field.resize(seq_length); - dcdr.deserializeArray(reinterpret_cast(m_unbounded_sequence_enum_field.data()), seq_length); - } - - { - uint32_t seq_length = 0; - dcdr >> seq_length; - m_unbounded_sequence_enum2_field.resize(seq_length); - dcdr.deserializeArray(reinterpret_cast(m_unbounded_sequence_enum2_field.data()), seq_length); - } - - dcdr >> m_unbounded_sequence_struct_field; + m_uint16_field = _uint16_field; } /*! - * @brief This function sets a value in member char_field - * @param _char_field New value for member char_field + * @brief This function returns the value of member uint16_field + * @return Value of member uint16_field */ -void CompleteTestType::char_field( - char _char_field) +uint16_t CompleteTestType::uint16_field() const { - m_char_field = _char_field; + return m_uint16_field; } /*! - * @brief This function returns the value of member char_field - * @return Value of member char_field + * @brief This function returns a reference to member uint16_field + * @return Reference to member uint16_field */ -char CompleteTestType::char_field() const +uint16_t& CompleteTestType::uint16_field() { - return m_char_field; + return m_uint16_field; } + /*! - * @brief This function returns a reference to member char_field - * @return Reference to member char_field + * @brief This function sets a value in member int32_field + * @param _int32_field New value for member int32_field */ -char& CompleteTestType::char_field() +void CompleteTestType::int32_field( + int32_t _int32_field) { - return m_char_field; + m_int32_field = _int32_field; } /*! - * @brief This function sets a value in member uint8_field - * @param _uint8_field New value for member uint8_field + * @brief This function returns the value of member int32_field + * @return Value of member int32_field */ -void CompleteTestType::uint8_field( - uint8_t _uint8_field) +int32_t CompleteTestType::int32_field() const { - m_uint8_field = _uint8_field; + return m_int32_field; } /*! - * @brief This function returns the value of member uint8_field - * @return Value of member uint8_field + * @brief This function returns a reference to member int32_field + * @return Reference to member int32_field */ -uint8_t CompleteTestType::uint8_field() const +int32_t& CompleteTestType::int32_field() { - return m_uint8_field; + return m_int32_field; } + /*! - * @brief This function returns a reference to member uint8_field - * @return Reference to member uint8_field + * @brief This function sets a value in member uint32_field + * @param _uint32_field New value for member uint32_field */ -uint8_t& CompleteTestType::uint8_field() +void CompleteTestType::uint32_field( + uint32_t _uint32_field) { - return m_uint8_field; + m_uint32_field = _uint32_field; } /*! - * @brief This function sets a value in member int16_field - * @param _int16_field New value for member int16_field + * @brief This function returns the value of member uint32_field + * @return Value of member uint32_field */ -void CompleteTestType::int16_field( - int16_t _int16_field) +uint32_t CompleteTestType::uint32_field() const { - m_int16_field = _int16_field; -} - -/*! - * @brief This function returns the value of member int16_field - * @return Value of member int16_field - */ -int16_t CompleteTestType::int16_field() const -{ - return m_int16_field; -} - -/*! - * @brief This function returns a reference to member int16_field - * @return Reference to member int16_field - */ -int16_t& CompleteTestType::int16_field() -{ - return m_int16_field; -} - -/*! - * @brief This function sets a value in member uint16_field - * @param _uint16_field New value for member uint16_field - */ -void CompleteTestType::uint16_field( - uint16_t _uint16_field) -{ - m_uint16_field = _uint16_field; -} - -/*! - * @brief This function returns the value of member uint16_field - * @return Value of member uint16_field - */ -uint16_t CompleteTestType::uint16_field() const -{ - return m_uint16_field; -} - -/*! - * @brief This function returns a reference to member uint16_field - * @return Reference to member uint16_field - */ -uint16_t& CompleteTestType::uint16_field() -{ - return m_uint16_field; -} - -/*! - * @brief This function sets a value in member int32_field - * @param _int32_field New value for member int32_field - */ -void CompleteTestType::int32_field( - int32_t _int32_field) -{ - m_int32_field = _int32_field; -} - -/*! - * @brief This function returns the value of member int32_field - * @return Value of member int32_field - */ -int32_t CompleteTestType::int32_field() const -{ - return m_int32_field; -} - -/*! - * @brief This function returns a reference to member int32_field - * @return Reference to member int32_field - */ -int32_t& CompleteTestType::int32_field() -{ - return m_int32_field; -} - -/*! - * @brief This function sets a value in member uint32_field - * @param _uint32_field New value for member uint32_field - */ -void CompleteTestType::uint32_field( - uint32_t _uint32_field) -{ - m_uint32_field = _uint32_field; -} - -/*! - * @brief This function returns the value of member uint32_field - * @return Value of member uint32_field - */ -uint32_t CompleteTestType::uint32_field() const -{ - return m_uint32_field; + return m_uint32_field; } /*! @@ -1884,6 +1074,7 @@ uint32_t& CompleteTestType::uint32_field() return m_uint32_field; } + /*! * @brief This function sets a value in member int64_field * @param _int64_field New value for member int64_field @@ -1912,6 +1103,7 @@ int64_t& CompleteTestType::int64_field() return m_int64_field; } + /*! * @brief This function sets a value in member uint64_field * @param _uint64_field New value for member uint64_field @@ -1940,6 +1132,7 @@ uint64_t& CompleteTestType::uint64_field() return m_uint64_field; } + /*! * @brief This function sets a value in member float_field * @param _float_field New value for member float_field @@ -1968,6 +1161,7 @@ float& CompleteTestType::float_field() return m_float_field; } + /*! * @brief This function sets a value in member double_field * @param _double_field New value for member double_field @@ -1996,6 +1190,7 @@ double& CompleteTestType::double_field() return m_double_field; } + /*! * @brief This function sets a value in member bool_field * @param _bool_field New value for member bool_field @@ -2024,6 +1219,7 @@ bool& CompleteTestType::bool_field() return m_bool_field; } + /*! * @brief This function copies the value in member string_field * @param _string_field New value to be copied in member string_field @@ -2061,6 +1257,8 @@ std::string& CompleteTestType::string_field() { return m_string_field; } + + /*! * @brief This function sets a value in member enum_field * @param _enum_field New value for member enum_field @@ -2089,6 +1287,7 @@ Color& CompleteTestType::enum_field() return m_enum_field; } + /*! * @brief This function sets a value in member enum2_field * @param _enum2_field New value for member enum2_field @@ -2117,6 +1316,7 @@ Material& CompleteTestType::enum2_field() return m_enum2_field; } + /*! * @brief This function copies the value in member struct_field * @param _struct_field New value to be copied in member struct_field @@ -2154,6 +1354,8 @@ StructType& CompleteTestType::struct_field() { return m_struct_field; } + + /*! * @brief This function copies the value in member array_char_field * @param _array_char_field New value to be copied in member array_char_field @@ -2191,6 +1393,8 @@ std::array& CompleteTestType::array_char_field() { return m_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 @@ -2228,6 +1432,8 @@ std::array& CompleteTestType::array_uint8_field() { return m_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 @@ -2265,6 +1471,8 @@ std::array& CompleteTestType::array_int16_field() { return m_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 @@ -2302,6 +1510,8 @@ std::array& CompleteTestType::array_uint16_field() { return m_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 @@ -2339,6 +1549,8 @@ std::array& CompleteTestType::array_int32_field() { return m_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 @@ -2376,6 +1588,8 @@ std::array& CompleteTestType::array_uint32_field() { return m_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 @@ -2413,6 +1627,8 @@ std::array& CompleteTestType::array_int64_field() { return m_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 @@ -2450,6 +1666,8 @@ std::array& CompleteTestType::array_uint64_field() { return m_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 @@ -2487,6 +1705,8 @@ std::array& CompleteTestType::array_float_field() { return m_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 @@ -2524,6 +1744,8 @@ std::array& CompleteTestType::array_double_field() { return m_array_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 @@ -2561,6 +1783,8 @@ std::array& CompleteTestType::array_bool_field() { return m_array_bool_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 @@ -2598,6 +1822,8 @@ std::array& CompleteTestType::array_enum_field() { return m_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 @@ -2635,6 +1861,8 @@ std::array& CompleteTestType::array_enum2_field() { return m_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 @@ -2672,6 +1900,8 @@ std::array& CompleteTestType::array_struct_field() { return m_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 @@ -2709,6 +1939,8 @@ std::vector& CompleteTestType::bounded_sequence_char_field() { return m_bounded_sequence_char_field; } + + /*! * @brief This function copies the value in member bounded_sequence_uint8_field * @param _bounded_sequence_uint8_field New value to be copied in member bounded_sequence_uint8_field @@ -2746,6 +1978,8 @@ std::vector& CompleteTestType::bounded_sequence_uint8_field() { return m_bounded_sequence_uint8_field; } + + /*! * @brief This function copies the value in member bounded_sequence_int16_field * @param _bounded_sequence_int16_field New value to be copied in member bounded_sequence_int16_field @@ -2783,6 +2017,8 @@ std::vector& CompleteTestType::bounded_sequence_int16_field() { return m_bounded_sequence_int16_field; } + + /*! * @brief This function copies the value in member bounded_sequence_uint16_field * @param _bounded_sequence_uint16_field New value to be copied in member bounded_sequence_uint16_field @@ -2820,6 +2056,8 @@ std::vector& CompleteTestType::bounded_sequence_uint16_field() { return m_bounded_sequence_uint16_field; } + + /*! * @brief This function copies the value in member bounded_sequence_int32_field * @param _bounded_sequence_int32_field New value to be copied in member bounded_sequence_int32_field @@ -2857,6 +2095,8 @@ std::vector& CompleteTestType::bounded_sequence_int32_field() { return m_bounded_sequence_int32_field; } + + /*! * @brief This function copies the value in member bounded_sequence_uint32_field * @param _bounded_sequence_uint32_field New value to be copied in member bounded_sequence_uint32_field @@ -2894,6 +2134,8 @@ std::vector& CompleteTestType::bounded_sequence_uint32_field() { return m_bounded_sequence_uint32_field; } + + /*! * @brief This function copies the value in member bounded_sequence_int64_field * @param _bounded_sequence_int64_field New value to be copied in member bounded_sequence_int64_field @@ -2931,6 +2173,8 @@ std::vector& CompleteTestType::bounded_sequence_int64_field() { return m_bounded_sequence_int64_field; } + + /*! * @brief This function copies the value in member bounded_sequence_uint64_field * @param _bounded_sequence_uint64_field New value to be copied in member bounded_sequence_uint64_field @@ -2968,6 +2212,8 @@ std::vector& CompleteTestType::bounded_sequence_uint64_field() { return m_bounded_sequence_uint64_field; } + + /*! * @brief This function copies the value in member bounded_sequence_float_field * @param _bounded_sequence_float_field New value to be copied in member bounded_sequence_float_field @@ -3005,6 +2251,8 @@ std::vector& CompleteTestType::bounded_sequence_float_field() { return m_bounded_sequence_float_field; } + + /*! * @brief This function copies the value in member bounded_sequence_double_field * @param _bounded_sequence_double_field New value to be copied in member bounded_sequence_double_field @@ -3042,6 +2290,8 @@ std::vector& CompleteTestType::bounded_sequence_double_field() { return m_bounded_sequence_double_field; } + + /*! * @brief This function copies the value in member bounded_sequence_bool_field * @param _bounded_sequence_bool_field New value to be copied in member bounded_sequence_bool_field @@ -3079,6 +2329,8 @@ std::vector& CompleteTestType::bounded_sequence_bool_field() { return m_bounded_sequence_bool_field; } + + /*! * @brief This function copies the value in member bounded_sequence_enum_field * @param _bounded_sequence_enum_field New value to be copied in member bounded_sequence_enum_field @@ -3116,6 +2368,8 @@ std::vector& CompleteTestType::bounded_sequence_enum_field() { return m_bounded_sequence_enum_field; } + + /*! * @brief This function copies the value in member bounded_sequence_enum2_field * @param _bounded_sequence_enum2_field New value to be copied in member bounded_sequence_enum2_field @@ -3153,6 +2407,8 @@ std::vector& CompleteTestType::bounded_sequence_enum2_field() { return m_bounded_sequence_enum2_field; } + + /*! * @brief This function copies the value in member bounded_sequence_struct_field * @param _bounded_sequence_struct_field New value to be copied in member bounded_sequence_struct_field @@ -3190,6 +2446,8 @@ std::vector& CompleteTestType::bounded_sequence_struct_field() { return m_bounded_sequence_struct_field; } + + /*! * @brief This function copies the value in member unbounded_sequence_char_field * @param _unbounded_sequence_char_field New value to be copied in member unbounded_sequence_char_field @@ -3227,6 +2485,8 @@ std::vector& CompleteTestType::unbounded_sequence_char_field() { return m_unbounded_sequence_char_field; } + + /*! * @brief This function copies the value in member unbounded_sequence_uint8_field * @param _unbounded_sequence_uint8_field New value to be copied in member unbounded_sequence_uint8_field @@ -3264,6 +2524,8 @@ std::vector& CompleteTestType::unbounded_sequence_uint8_field() { return m_unbounded_sequence_uint8_field; } + + /*! * @brief This function copies the value in member unbounded_sequence_int16_field * @param _unbounded_sequence_int16_field New value to be copied in member unbounded_sequence_int16_field @@ -3301,6 +2563,8 @@ std::vector& CompleteTestType::unbounded_sequence_int16_field() { return m_unbounded_sequence_int16_field; } + + /*! * @brief This function copies the value in member unbounded_sequence_uint16_field * @param _unbounded_sequence_uint16_field New value to be copied in member unbounded_sequence_uint16_field @@ -3338,6 +2602,8 @@ std::vector& CompleteTestType::unbounded_sequence_uint16_field() { return m_unbounded_sequence_uint16_field; } + + /*! * @brief This function copies the value in member unbounded_sequence_int32_field * @param _unbounded_sequence_int32_field New value to be copied in member unbounded_sequence_int32_field @@ -3375,6 +2641,8 @@ std::vector& CompleteTestType::unbounded_sequence_int32_field() { return m_unbounded_sequence_int32_field; } + + /*! * @brief This function copies the value in member unbounded_sequence_uint32_field * @param _unbounded_sequence_uint32_field New value to be copied in member unbounded_sequence_uint32_field @@ -3412,6 +2680,8 @@ std::vector& CompleteTestType::unbounded_sequence_uint32_field() { return m_unbounded_sequence_uint32_field; } + + /*! * @brief This function copies the value in member unbounded_sequence_int64_field * @param _unbounded_sequence_int64_field New value to be copied in member unbounded_sequence_int64_field @@ -3449,6 +2719,8 @@ std::vector& CompleteTestType::unbounded_sequence_int64_field() { return m_unbounded_sequence_int64_field; } + + /*! * @brief This function copies the value in member unbounded_sequence_uint64_field * @param _unbounded_sequence_uint64_field New value to be copied in member unbounded_sequence_uint64_field @@ -3486,6 +2758,8 @@ std::vector& CompleteTestType::unbounded_sequence_uint64_field() { return m_unbounded_sequence_uint64_field; } + + /*! * @brief This function copies the value in member unbounded_sequence_float_field * @param _unbounded_sequence_float_field New value to be copied in member unbounded_sequence_float_field @@ -3523,6 +2797,8 @@ std::vector& CompleteTestType::unbounded_sequence_float_field() { return m_unbounded_sequence_float_field; } + + /*! * @brief This function copies the value in member unbounded_sequence_double_field * @param _unbounded_sequence_double_field New value to be copied in member unbounded_sequence_double_field @@ -3560,6 +2836,8 @@ std::vector& CompleteTestType::unbounded_sequence_double_field() { return m_unbounded_sequence_double_field; } + + /*! * @brief This function copies the value in member unbounded_sequence_bool_field * @param _unbounded_sequence_bool_field New value to be copied in member unbounded_sequence_bool_field @@ -3597,6 +2875,8 @@ std::vector& CompleteTestType::unbounded_sequence_bool_field() { return m_unbounded_sequence_bool_field; } + + /*! * @brief This function copies the value in member unbounded_sequence_enum_field * @param _unbounded_sequence_enum_field New value to be copied in member unbounded_sequence_enum_field @@ -3634,6 +2914,8 @@ std::vector& CompleteTestType::unbounded_sequence_enum_field() { return m_unbounded_sequence_enum_field; } + + /*! * @brief This function copies the value in member unbounded_sequence_enum2_field * @param _unbounded_sequence_enum2_field New value to be copied in member unbounded_sequence_enum2_field @@ -3671,6 +2953,8 @@ std::vector& CompleteTestType::unbounded_sequence_enum2_field() { return m_unbounded_sequence_enum2_field; } + + /*! * @brief This function copies the value in member unbounded_sequence_struct_field * @param _unbounded_sequence_struct_field New value to be copied in member unbounded_sequence_struct_field @@ -3684,364 +2968,44 @@ void CompleteTestType::unbounded_sequence_struct_field( /*! * @brief This function moves the value in member unbounded_sequence_struct_field * @param _unbounded_sequence_struct_field New value to be moved in member unbounded_sequence_struct_field - */ -void CompleteTestType::unbounded_sequence_struct_field( - std::vector&& _unbounded_sequence_struct_field) -{ - m_unbounded_sequence_struct_field = std::move(_unbounded_sequence_struct_field); -} - -/*! - * @brief This function returns a constant reference to member unbounded_sequence_struct_field - * @return Constant reference to member unbounded_sequence_struct_field - */ -const std::vector& CompleteTestType::unbounded_sequence_struct_field() const -{ - return m_unbounded_sequence_struct_field; -} - -/*! - * @brief This function returns a reference to member unbounded_sequence_struct_field - * @return Reference to member unbounded_sequence_struct_field - */ -std::vector& CompleteTestType::unbounded_sequence_struct_field() -{ - return m_unbounded_sequence_struct_field; -} - - -size_t CompleteTestType::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return CompleteTestType_max_key_cdr_typesize; -} - -bool CompleteTestType::isKeyDefined() -{ - return false; -} - -void CompleteTestType::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - - -KeyedCompleteTestType::KeyedCompleteTestType() -{ - // long m_id - m_id = 0; - // char m_char_field - m_char_field = 0; - // octet m_uint8_field - m_uint8_field = 0; - // short m_int16_field - m_int16_field = 0; - // unsigned short m_uint16_field - m_uint16_field = 0; - // long m_int32_field - m_int32_field = 0; - // unsigned long m_uint32_field - m_uint32_field = 0; - // long long m_int64_field - m_int64_field = 0; - // unsigned long long m_uint64_field - m_uint64_field = 0; - // float m_float_field - m_float_field = 0.0; - // double m_double_field - m_double_field = 0.0; - // boolean m_bool_field - m_bool_field = false; - // string m_string_field - m_string_field =""; - // Color m_enum_field - m_enum_field = ::RED; - // Material m_enum2_field - m_enum2_field = ::WOOD; - // StructType m_struct_field - - // 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); - // boolean m_array_bool_field - memset(&m_array_bool_field, 0, (3) * 1); - // 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 - - // sequence m_bounded_sequence_char_field - - // sequence m_bounded_sequence_uint8_field - - // sequence m_bounded_sequence_int16_field - - // sequence m_bounded_sequence_uint16_field - - // sequence m_bounded_sequence_int32_field - - // sequence m_bounded_sequence_uint32_field - - // sequence m_bounded_sequence_int64_field - - // sequence m_bounded_sequence_uint64_field - - // sequence m_bounded_sequence_float_field - - // sequence m_bounded_sequence_double_field - - // sequence m_bounded_sequence_bool_field - - // sequence m_bounded_sequence_enum_field - - // sequence m_bounded_sequence_enum2_field - - // sequence m_bounded_sequence_struct_field - - // sequence m_unbounded_sequence_char_field - - // sequence m_unbounded_sequence_uint8_field - - // sequence m_unbounded_sequence_int16_field - - // sequence m_unbounded_sequence_uint16_field - - // sequence m_unbounded_sequence_int32_field - - // sequence m_unbounded_sequence_uint32_field - - // sequence m_unbounded_sequence_int64_field - - // sequence m_unbounded_sequence_uint64_field - - // sequence m_unbounded_sequence_float_field - - // sequence m_unbounded_sequence_double_field - - // sequence m_unbounded_sequence_bool_field - - // sequence m_unbounded_sequence_enum_field - - // sequence m_unbounded_sequence_enum2_field - - // sequence m_unbounded_sequence_struct_field - - -} - -KeyedCompleteTestType::~KeyedCompleteTestType() -{ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -} - -KeyedCompleteTestType::KeyedCompleteTestType( - const KeyedCompleteTestType& x) -{ - m_id = x.m_id; - m_char_field = x.m_char_field; - m_uint8_field = x.m_uint8_field; - m_int16_field = x.m_int16_field; - m_uint16_field = x.m_uint16_field; - m_int32_field = x.m_int32_field; - m_uint32_field = x.m_uint32_field; - m_int64_field = x.m_int64_field; - m_uint64_field = x.m_uint64_field; - m_float_field = x.m_float_field; - m_double_field = x.m_double_field; - m_bool_field = x.m_bool_field; - m_string_field = x.m_string_field; - m_enum_field = x.m_enum_field; - m_enum2_field = x.m_enum2_field; - m_struct_field = x.m_struct_field; - m_array_char_field = x.m_array_char_field; - m_array_uint8_field = x.m_array_uint8_field; - m_array_int16_field = x.m_array_int16_field; - m_array_uint16_field = x.m_array_uint16_field; - m_array_int32_field = x.m_array_int32_field; - m_array_uint32_field = x.m_array_uint32_field; - m_array_int64_field = x.m_array_int64_field; - m_array_uint64_field = x.m_array_uint64_field; - m_array_float_field = x.m_array_float_field; - m_array_double_field = x.m_array_double_field; - m_array_bool_field = x.m_array_bool_field; - m_array_enum_field = x.m_array_enum_field; - m_array_enum2_field = x.m_array_enum2_field; - m_array_struct_field = x.m_array_struct_field; - m_bounded_sequence_char_field = x.m_bounded_sequence_char_field; - m_bounded_sequence_uint8_field = x.m_bounded_sequence_uint8_field; - m_bounded_sequence_int16_field = x.m_bounded_sequence_int16_field; - m_bounded_sequence_uint16_field = x.m_bounded_sequence_uint16_field; - m_bounded_sequence_int32_field = x.m_bounded_sequence_int32_field; - m_bounded_sequence_uint32_field = x.m_bounded_sequence_uint32_field; - m_bounded_sequence_int64_field = x.m_bounded_sequence_int64_field; - m_bounded_sequence_uint64_field = x.m_bounded_sequence_uint64_field; - m_bounded_sequence_float_field = x.m_bounded_sequence_float_field; - m_bounded_sequence_double_field = x.m_bounded_sequence_double_field; - m_bounded_sequence_bool_field = x.m_bounded_sequence_bool_field; - m_bounded_sequence_enum_field = x.m_bounded_sequence_enum_field; - m_bounded_sequence_enum2_field = x.m_bounded_sequence_enum2_field; - m_bounded_sequence_struct_field = x.m_bounded_sequence_struct_field; - m_unbounded_sequence_char_field = x.m_unbounded_sequence_char_field; - m_unbounded_sequence_uint8_field = x.m_unbounded_sequence_uint8_field; - m_unbounded_sequence_int16_field = x.m_unbounded_sequence_int16_field; - m_unbounded_sequence_uint16_field = x.m_unbounded_sequence_uint16_field; - m_unbounded_sequence_int32_field = x.m_unbounded_sequence_int32_field; - m_unbounded_sequence_uint32_field = x.m_unbounded_sequence_uint32_field; - m_unbounded_sequence_int64_field = x.m_unbounded_sequence_int64_field; - m_unbounded_sequence_uint64_field = x.m_unbounded_sequence_uint64_field; - m_unbounded_sequence_float_field = x.m_unbounded_sequence_float_field; - m_unbounded_sequence_double_field = x.m_unbounded_sequence_double_field; - m_unbounded_sequence_bool_field = x.m_unbounded_sequence_bool_field; - m_unbounded_sequence_enum_field = x.m_unbounded_sequence_enum_field; - m_unbounded_sequence_enum2_field = x.m_unbounded_sequence_enum2_field; - m_unbounded_sequence_struct_field = x.m_unbounded_sequence_struct_field; -} - -KeyedCompleteTestType::KeyedCompleteTestType( - KeyedCompleteTestType&& x) noexcept -{ - m_id = x.m_id; - m_char_field = x.m_char_field; - m_uint8_field = x.m_uint8_field; - m_int16_field = x.m_int16_field; - m_uint16_field = x.m_uint16_field; - m_int32_field = x.m_int32_field; - m_uint32_field = x.m_uint32_field; - m_int64_field = x.m_int64_field; - m_uint64_field = x.m_uint64_field; - m_float_field = x.m_float_field; - m_double_field = x.m_double_field; - m_bool_field = x.m_bool_field; - m_string_field = std::move(x.m_string_field); - m_enum_field = x.m_enum_field; - m_enum2_field = x.m_enum2_field; - m_struct_field = std::move(x.m_struct_field); - m_array_char_field = std::move(x.m_array_char_field); - m_array_uint8_field = std::move(x.m_array_uint8_field); - m_array_int16_field = std::move(x.m_array_int16_field); - m_array_uint16_field = std::move(x.m_array_uint16_field); - m_array_int32_field = std::move(x.m_array_int32_field); - m_array_uint32_field = std::move(x.m_array_uint32_field); - m_array_int64_field = std::move(x.m_array_int64_field); - m_array_uint64_field = std::move(x.m_array_uint64_field); - m_array_float_field = std::move(x.m_array_float_field); - m_array_double_field = std::move(x.m_array_double_field); - m_array_bool_field = std::move(x.m_array_bool_field); - m_array_enum_field = std::move(x.m_array_enum_field); - m_array_enum2_field = std::move(x.m_array_enum2_field); - m_array_struct_field = std::move(x.m_array_struct_field); - m_bounded_sequence_char_field = std::move(x.m_bounded_sequence_char_field); - m_bounded_sequence_uint8_field = std::move(x.m_bounded_sequence_uint8_field); - m_bounded_sequence_int16_field = std::move(x.m_bounded_sequence_int16_field); - m_bounded_sequence_uint16_field = std::move(x.m_bounded_sequence_uint16_field); - m_bounded_sequence_int32_field = std::move(x.m_bounded_sequence_int32_field); - m_bounded_sequence_uint32_field = std::move(x.m_bounded_sequence_uint32_field); - m_bounded_sequence_int64_field = std::move(x.m_bounded_sequence_int64_field); - m_bounded_sequence_uint64_field = std::move(x.m_bounded_sequence_uint64_field); - m_bounded_sequence_float_field = std::move(x.m_bounded_sequence_float_field); - m_bounded_sequence_double_field = std::move(x.m_bounded_sequence_double_field); - m_bounded_sequence_bool_field = std::move(x.m_bounded_sequence_bool_field); - m_bounded_sequence_enum_field = std::move(x.m_bounded_sequence_enum_field); - m_bounded_sequence_enum2_field = std::move(x.m_bounded_sequence_enum2_field); - m_bounded_sequence_struct_field = std::move(x.m_bounded_sequence_struct_field); - m_unbounded_sequence_char_field = std::move(x.m_unbounded_sequence_char_field); - m_unbounded_sequence_uint8_field = std::move(x.m_unbounded_sequence_uint8_field); - m_unbounded_sequence_int16_field = std::move(x.m_unbounded_sequence_int16_field); - m_unbounded_sequence_uint16_field = std::move(x.m_unbounded_sequence_uint16_field); - m_unbounded_sequence_int32_field = std::move(x.m_unbounded_sequence_int32_field); - m_unbounded_sequence_uint32_field = std::move(x.m_unbounded_sequence_uint32_field); - m_unbounded_sequence_int64_field = std::move(x.m_unbounded_sequence_int64_field); - m_unbounded_sequence_uint64_field = std::move(x.m_unbounded_sequence_uint64_field); - m_unbounded_sequence_float_field = std::move(x.m_unbounded_sequence_float_field); - m_unbounded_sequence_double_field = std::move(x.m_unbounded_sequence_double_field); - m_unbounded_sequence_bool_field = std::move(x.m_unbounded_sequence_bool_field); - m_unbounded_sequence_enum_field = std::move(x.m_unbounded_sequence_enum_field); - m_unbounded_sequence_enum2_field = std::move(x.m_unbounded_sequence_enum2_field); - m_unbounded_sequence_struct_field = std::move(x.m_unbounded_sequence_struct_field); + */ +void CompleteTestType::unbounded_sequence_struct_field( + std::vector&& _unbounded_sequence_struct_field) +{ + m_unbounded_sequence_struct_field = std::move(_unbounded_sequence_struct_field); } -KeyedCompleteTestType& KeyedCompleteTestType::operator =( - const KeyedCompleteTestType& x) +/*! + * @brief This function returns a constant reference to member unbounded_sequence_struct_field + * @return Constant reference to member unbounded_sequence_struct_field + */ +const std::vector& CompleteTestType::unbounded_sequence_struct_field() const +{ + return m_unbounded_sequence_struct_field; +} + +/*! + * @brief This function returns a reference to member unbounded_sequence_struct_field + * @return Reference to member unbounded_sequence_struct_field + */ +std::vector& CompleteTestType::unbounded_sequence_struct_field() +{ + return m_unbounded_sequence_struct_field; +} + + +KeyedCompleteTestType::KeyedCompleteTestType() +{ + +} + +KeyedCompleteTestType::~KeyedCompleteTestType() { +} +KeyedCompleteTestType::KeyedCompleteTestType( + const KeyedCompleteTestType& x) +{ m_id = x.m_id; m_char_field = x.m_char_field; m_uint8_field = x.m_uint8_field; @@ -4100,14 +3064,11 @@ KeyedCompleteTestType& KeyedCompleteTestType::operator =( m_unbounded_sequence_enum_field = x.m_unbounded_sequence_enum_field; m_unbounded_sequence_enum2_field = x.m_unbounded_sequence_enum2_field; m_unbounded_sequence_struct_field = x.m_unbounded_sequence_struct_field; - - return *this; } -KeyedCompleteTestType& KeyedCompleteTestType::operator =( +KeyedCompleteTestType::KeyedCompleteTestType( KeyedCompleteTestType&& x) noexcept { - m_id = x.m_id; m_char_field = x.m_char_field; m_uint8_field = x.m_uint8_field; @@ -4152,581 +3113,221 @@ KeyedCompleteTestType& KeyedCompleteTestType::operator =( m_bounded_sequence_enum_field = std::move(x.m_bounded_sequence_enum_field); m_bounded_sequence_enum2_field = std::move(x.m_bounded_sequence_enum2_field); m_bounded_sequence_struct_field = std::move(x.m_bounded_sequence_struct_field); - m_unbounded_sequence_char_field = std::move(x.m_unbounded_sequence_char_field); - m_unbounded_sequence_uint8_field = std::move(x.m_unbounded_sequence_uint8_field); - m_unbounded_sequence_int16_field = std::move(x.m_unbounded_sequence_int16_field); - m_unbounded_sequence_uint16_field = std::move(x.m_unbounded_sequence_uint16_field); - m_unbounded_sequence_int32_field = std::move(x.m_unbounded_sequence_int32_field); - m_unbounded_sequence_uint32_field = std::move(x.m_unbounded_sequence_uint32_field); - m_unbounded_sequence_int64_field = std::move(x.m_unbounded_sequence_int64_field); - m_unbounded_sequence_uint64_field = std::move(x.m_unbounded_sequence_uint64_field); - m_unbounded_sequence_float_field = std::move(x.m_unbounded_sequence_float_field); - m_unbounded_sequence_double_field = std::move(x.m_unbounded_sequence_double_field); - m_unbounded_sequence_bool_field = std::move(x.m_unbounded_sequence_bool_field); - m_unbounded_sequence_enum_field = std::move(x.m_unbounded_sequence_enum_field); - m_unbounded_sequence_enum2_field = std::move(x.m_unbounded_sequence_enum2_field); - m_unbounded_sequence_struct_field = std::move(x.m_unbounded_sequence_struct_field); - - return *this; -} - -bool KeyedCompleteTestType::operator ==( - const KeyedCompleteTestType& x) const -{ - - return (m_id == x.m_id && m_char_field == x.m_char_field && m_uint8_field == x.m_uint8_field && m_int16_field == x.m_int16_field && m_uint16_field == x.m_uint16_field && m_int32_field == x.m_int32_field && m_uint32_field == x.m_uint32_field && m_int64_field == x.m_int64_field && m_uint64_field == x.m_uint64_field && m_float_field == x.m_float_field && m_double_field == x.m_double_field && m_bool_field == x.m_bool_field && m_string_field == x.m_string_field && m_enum_field == x.m_enum_field && m_enum2_field == x.m_enum2_field && m_struct_field == x.m_struct_field && m_array_char_field == x.m_array_char_field && m_array_uint8_field == x.m_array_uint8_field && m_array_int16_field == x.m_array_int16_field && m_array_uint16_field == x.m_array_uint16_field && m_array_int32_field == x.m_array_int32_field && m_array_uint32_field == x.m_array_uint32_field && m_array_int64_field == x.m_array_int64_field && m_array_uint64_field == x.m_array_uint64_field && m_array_float_field == x.m_array_float_field && m_array_double_field == x.m_array_double_field && m_array_bool_field == x.m_array_bool_field && m_array_enum_field == x.m_array_enum_field && m_array_enum2_field == x.m_array_enum2_field && m_array_struct_field == x.m_array_struct_field && m_bounded_sequence_char_field == x.m_bounded_sequence_char_field && m_bounded_sequence_uint8_field == x.m_bounded_sequence_uint8_field && m_bounded_sequence_int16_field == x.m_bounded_sequence_int16_field && m_bounded_sequence_uint16_field == x.m_bounded_sequence_uint16_field && m_bounded_sequence_int32_field == x.m_bounded_sequence_int32_field && m_bounded_sequence_uint32_field == x.m_bounded_sequence_uint32_field && m_bounded_sequence_int64_field == x.m_bounded_sequence_int64_field && m_bounded_sequence_uint64_field == x.m_bounded_sequence_uint64_field && m_bounded_sequence_float_field == x.m_bounded_sequence_float_field && m_bounded_sequence_double_field == x.m_bounded_sequence_double_field && m_bounded_sequence_bool_field == x.m_bounded_sequence_bool_field && m_bounded_sequence_enum_field == x.m_bounded_sequence_enum_field && m_bounded_sequence_enum2_field == x.m_bounded_sequence_enum2_field && m_bounded_sequence_struct_field == x.m_bounded_sequence_struct_field && m_unbounded_sequence_char_field == x.m_unbounded_sequence_char_field && m_unbounded_sequence_uint8_field == x.m_unbounded_sequence_uint8_field && m_unbounded_sequence_int16_field == x.m_unbounded_sequence_int16_field && m_unbounded_sequence_uint16_field == x.m_unbounded_sequence_uint16_field && m_unbounded_sequence_int32_field == x.m_unbounded_sequence_int32_field && m_unbounded_sequence_uint32_field == x.m_unbounded_sequence_uint32_field && m_unbounded_sequence_int64_field == x.m_unbounded_sequence_int64_field && m_unbounded_sequence_uint64_field == x.m_unbounded_sequence_uint64_field && m_unbounded_sequence_float_field == x.m_unbounded_sequence_float_field && m_unbounded_sequence_double_field == x.m_unbounded_sequence_double_field && m_unbounded_sequence_bool_field == x.m_unbounded_sequence_bool_field && m_unbounded_sequence_enum_field == x.m_unbounded_sequence_enum_field && m_unbounded_sequence_enum2_field == x.m_unbounded_sequence_enum2_field && m_unbounded_sequence_struct_field == x.m_unbounded_sequence_struct_field); -} - -bool KeyedCompleteTestType::operator !=( - const KeyedCompleteTestType& x) const -{ - return !(*this == x); -} - -size_t KeyedCompleteTestType::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return KeyedCompleteTestType_max_cdr_typesize; -} - -size_t KeyedCompleteTestType::getCdrSerializedSize( - const KeyedCompleteTestType& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - 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 += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - 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); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += StructType::getCdrSerializedSize(data.struct_field(), current_alignment); - current_alignment += ((3) * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - current_alignment += ((3) * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - current_alignment += ((3) * 2) + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); - - current_alignment += ((3) * 2) + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); - - current_alignment += ((3) * 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 += ((3) * 8) + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - current_alignment += ((3) * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - current_alignment += ((3) * 8) + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - current_alignment += ((3) * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - 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) - { - current_alignment += StructType::getCdrSerializedSize(data.array_struct_field().at(a), current_alignment); - } - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - if (data.bounded_sequence_char_field().size() > 0) - { - current_alignment += (data.bounded_sequence_char_field().size() * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - } - - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - if (data.bounded_sequence_uint8_field().size() > 0) - { - current_alignment += (data.bounded_sequence_uint8_field().size() * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - } - - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - if (data.bounded_sequence_int16_field().size() > 0) - { - current_alignment += (data.bounded_sequence_int16_field().size() * 2) + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); - } - - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - if (data.bounded_sequence_uint16_field().size() > 0) - { - current_alignment += (data.bounded_sequence_uint16_field().size() * 2) + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); - } - - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - if (data.bounded_sequence_int32_field().size() > 0) - { - current_alignment += (data.bounded_sequence_int32_field().size() * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - } - - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - if (data.bounded_sequence_uint32_field().size() > 0) - { - current_alignment += (data.bounded_sequence_uint32_field().size() * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - } - - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - if (data.bounded_sequence_int64_field().size() > 0) - { - current_alignment += (data.bounded_sequence_int64_field().size() * 8) + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - } - - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - if (data.bounded_sequence_uint64_field().size() > 0) - { - current_alignment += (data.bounded_sequence_uint64_field().size() * 8) + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - } - - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - if (data.bounded_sequence_float_field().size() > 0) - { - current_alignment += (data.bounded_sequence_float_field().size() * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - } - - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - if (data.bounded_sequence_double_field().size() > 0) - { - current_alignment += (data.bounded_sequence_double_field().size() * 8) + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - } - - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - if (data.bounded_sequence_bool_field().size() > 0) - { - current_alignment += (data.bounded_sequence_bool_field().size() * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - } - - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - if (data.bounded_sequence_enum_field().size() > 0) - { - current_alignment += (data.bounded_sequence_enum_field().size() * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - } - - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - if (data.bounded_sequence_enum2_field().size() > 0) - { - current_alignment += (data.bounded_sequence_enum2_field().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 < data.bounded_sequence_struct_field().size(); ++a) - { - current_alignment += StructType::getCdrSerializedSize(data.bounded_sequence_struct_field().at(a), current_alignment);} - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - if (data.unbounded_sequence_char_field().size() > 0) - { - current_alignment += (data.unbounded_sequence_char_field().size() * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - } - - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - if (data.unbounded_sequence_uint8_field().size() > 0) - { - current_alignment += (data.unbounded_sequence_uint8_field().size() * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - } - - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - if (data.unbounded_sequence_int16_field().size() > 0) - { - current_alignment += (data.unbounded_sequence_int16_field().size() * 2) + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); - } - - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - if (data.unbounded_sequence_uint16_field().size() > 0) - { - current_alignment += (data.unbounded_sequence_uint16_field().size() * 2) + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); - } - - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - if (data.unbounded_sequence_int32_field().size() > 0) - { - current_alignment += (data.unbounded_sequence_int32_field().size() * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - } - - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - if (data.unbounded_sequence_uint32_field().size() > 0) - { - current_alignment += (data.unbounded_sequence_uint32_field().size() * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - } - - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - if (data.unbounded_sequence_int64_field().size() > 0) - { - current_alignment += (data.unbounded_sequence_int64_field().size() * 8) + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - } - - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - if (data.unbounded_sequence_uint64_field().size() > 0) - { - current_alignment += (data.unbounded_sequence_uint64_field().size() * 8) + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - } - - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - if (data.unbounded_sequence_float_field().size() > 0) - { - current_alignment += (data.unbounded_sequence_float_field().size() * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - } - - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - if (data.unbounded_sequence_double_field().size() > 0) - { - current_alignment += (data.unbounded_sequence_double_field().size() * 8) + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - } - - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - if (data.unbounded_sequence_bool_field().size() > 0) - { - current_alignment += (data.unbounded_sequence_bool_field().size() * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - } - - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - if (data.unbounded_sequence_enum_field().size() > 0) - { - current_alignment += (data.unbounded_sequence_enum_field().size() * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - } - - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - if (data.unbounded_sequence_enum2_field().size() > 0) - { - current_alignment += (data.unbounded_sequence_enum2_field().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 < data.unbounded_sequence_struct_field().size(); ++a) - { - current_alignment += StructType::getCdrSerializedSize(data.unbounded_sequence_struct_field().at(a), current_alignment);} - - - return current_alignment - initial_alignment; -} - -void KeyedCompleteTestType::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_id; - scdr << m_char_field; - scdr << m_uint8_field; - scdr << m_int16_field; - scdr << m_uint16_field; - scdr << m_int32_field; - scdr << m_uint32_field; - scdr << m_int64_field; - scdr << m_uint64_field; - scdr << m_float_field; - scdr << m_double_field; - scdr << m_bool_field; - scdr << m_string_field.c_str(); - scdr << (uint32_t)m_enum_field; - scdr << (uint32_t)m_enum2_field; - scdr << m_struct_field; - scdr << m_array_char_field; - - scdr << m_array_uint8_field; - - scdr << m_array_int16_field; - - scdr << m_array_uint16_field; - - scdr << m_array_int32_field; - - scdr << m_array_uint32_field; - - scdr << m_array_int64_field; - - scdr << m_array_uint64_field; - - scdr << m_array_float_field; - - scdr << m_array_double_field; - - scdr << m_array_bool_field; - - scdr.serializeArray(reinterpret_cast(m_array_enum_field.data()), m_array_enum_field.size()); - - - scdr.serializeArray(reinterpret_cast(m_array_enum2_field.data()), m_array_enum2_field.size()); - - - scdr << m_array_struct_field; - - scdr << m_bounded_sequence_char_field; - scdr << m_bounded_sequence_uint8_field; - scdr << m_bounded_sequence_int16_field; - scdr << m_bounded_sequence_uint16_field; - scdr << m_bounded_sequence_int32_field; - scdr << m_bounded_sequence_uint32_field; - scdr << m_bounded_sequence_int64_field; - scdr << m_bounded_sequence_uint64_field; - scdr << m_bounded_sequence_float_field; - scdr << m_bounded_sequence_double_field; - scdr << m_bounded_sequence_bool_field; - scdr << static_cast(m_bounded_sequence_enum_field.size()); - scdr.serializeArray(reinterpret_cast(m_bounded_sequence_enum_field.data()), m_bounded_sequence_enum_field.size()); - - scdr << static_cast(m_bounded_sequence_enum2_field.size()); - scdr.serializeArray(reinterpret_cast(m_bounded_sequence_enum2_field.data()), m_bounded_sequence_enum2_field.size()); - - scdr << m_bounded_sequence_struct_field; - scdr << m_unbounded_sequence_char_field; - scdr << m_unbounded_sequence_uint8_field; - scdr << m_unbounded_sequence_int16_field; - scdr << m_unbounded_sequence_uint16_field; - scdr << m_unbounded_sequence_int32_field; - scdr << m_unbounded_sequence_uint32_field; - scdr << m_unbounded_sequence_int64_field; - scdr << m_unbounded_sequence_uint64_field; - scdr << m_unbounded_sequence_float_field; - scdr << m_unbounded_sequence_double_field; - scdr << m_unbounded_sequence_bool_field; - scdr << static_cast(m_unbounded_sequence_enum_field.size()); - scdr.serializeArray(reinterpret_cast(m_unbounded_sequence_enum_field.data()), m_unbounded_sequence_enum_field.size()); - - scdr << static_cast(m_unbounded_sequence_enum2_field.size()); - scdr.serializeArray(reinterpret_cast(m_unbounded_sequence_enum2_field.data()), m_unbounded_sequence_enum2_field.size()); - - scdr << m_unbounded_sequence_struct_field; - + m_unbounded_sequence_char_field = std::move(x.m_unbounded_sequence_char_field); + m_unbounded_sequence_uint8_field = std::move(x.m_unbounded_sequence_uint8_field); + m_unbounded_sequence_int16_field = std::move(x.m_unbounded_sequence_int16_field); + m_unbounded_sequence_uint16_field = std::move(x.m_unbounded_sequence_uint16_field); + m_unbounded_sequence_int32_field = std::move(x.m_unbounded_sequence_int32_field); + m_unbounded_sequence_uint32_field = std::move(x.m_unbounded_sequence_uint32_field); + m_unbounded_sequence_int64_field = std::move(x.m_unbounded_sequence_int64_field); + m_unbounded_sequence_uint64_field = std::move(x.m_unbounded_sequence_uint64_field); + m_unbounded_sequence_float_field = std::move(x.m_unbounded_sequence_float_field); + m_unbounded_sequence_double_field = std::move(x.m_unbounded_sequence_double_field); + m_unbounded_sequence_bool_field = std::move(x.m_unbounded_sequence_bool_field); + m_unbounded_sequence_enum_field = std::move(x.m_unbounded_sequence_enum_field); + m_unbounded_sequence_enum2_field = std::move(x.m_unbounded_sequence_enum2_field); + m_unbounded_sequence_struct_field = std::move(x.m_unbounded_sequence_struct_field); } -void KeyedCompleteTestType::deserialize( - eprosima::fastcdr::Cdr& dcdr) +KeyedCompleteTestType& KeyedCompleteTestType::operator =( + const KeyedCompleteTestType& x) { - dcdr >> m_id; - dcdr >> m_char_field; - dcdr >> m_uint8_field; - dcdr >> m_int16_field; - dcdr >> m_uint16_field; - dcdr >> m_int32_field; - dcdr >> m_uint32_field; - dcdr >> m_int64_field; - dcdr >> m_uint64_field; - dcdr >> m_float_field; - dcdr >> m_double_field; - dcdr >> m_bool_field; - dcdr >> m_string_field; - { - uint32_t enum_value = 0; - dcdr >> enum_value; - m_enum_field = (Color)enum_value; - } - - { - uint32_t enum_value = 0; - dcdr >> enum_value; - m_enum2_field = (Material)enum_value; - } - - dcdr >> m_struct_field; - dcdr >> m_array_char_field; - - dcdr >> m_array_uint8_field; - - dcdr >> m_array_int16_field; - - dcdr >> m_array_uint16_field; - - dcdr >> m_array_int32_field; - - dcdr >> m_array_uint32_field; + m_id = x.m_id; + m_char_field = x.m_char_field; + m_uint8_field = x.m_uint8_field; + m_int16_field = x.m_int16_field; + m_uint16_field = x.m_uint16_field; + m_int32_field = x.m_int32_field; + m_uint32_field = x.m_uint32_field; + m_int64_field = x.m_int64_field; + m_uint64_field = x.m_uint64_field; + m_float_field = x.m_float_field; + m_double_field = x.m_double_field; + m_bool_field = x.m_bool_field; + m_string_field = x.m_string_field; + m_enum_field = x.m_enum_field; + m_enum2_field = x.m_enum2_field; + m_struct_field = x.m_struct_field; + m_array_char_field = x.m_array_char_field; + m_array_uint8_field = x.m_array_uint8_field; + m_array_int16_field = x.m_array_int16_field; + m_array_uint16_field = x.m_array_uint16_field; + m_array_int32_field = x.m_array_int32_field; + m_array_uint32_field = x.m_array_uint32_field; + m_array_int64_field = x.m_array_int64_field; + m_array_uint64_field = x.m_array_uint64_field; + m_array_float_field = x.m_array_float_field; + m_array_double_field = x.m_array_double_field; + m_array_bool_field = x.m_array_bool_field; + m_array_enum_field = x.m_array_enum_field; + m_array_enum2_field = x.m_array_enum2_field; + m_array_struct_field = x.m_array_struct_field; + m_bounded_sequence_char_field = x.m_bounded_sequence_char_field; + m_bounded_sequence_uint8_field = x.m_bounded_sequence_uint8_field; + m_bounded_sequence_int16_field = x.m_bounded_sequence_int16_field; + m_bounded_sequence_uint16_field = x.m_bounded_sequence_uint16_field; + m_bounded_sequence_int32_field = x.m_bounded_sequence_int32_field; + m_bounded_sequence_uint32_field = x.m_bounded_sequence_uint32_field; + m_bounded_sequence_int64_field = x.m_bounded_sequence_int64_field; + m_bounded_sequence_uint64_field = x.m_bounded_sequence_uint64_field; + m_bounded_sequence_float_field = x.m_bounded_sequence_float_field; + m_bounded_sequence_double_field = x.m_bounded_sequence_double_field; + m_bounded_sequence_bool_field = x.m_bounded_sequence_bool_field; + m_bounded_sequence_enum_field = x.m_bounded_sequence_enum_field; + m_bounded_sequence_enum2_field = x.m_bounded_sequence_enum2_field; + m_bounded_sequence_struct_field = x.m_bounded_sequence_struct_field; + m_unbounded_sequence_char_field = x.m_unbounded_sequence_char_field; + m_unbounded_sequence_uint8_field = x.m_unbounded_sequence_uint8_field; + m_unbounded_sequence_int16_field = x.m_unbounded_sequence_int16_field; + m_unbounded_sequence_uint16_field = x.m_unbounded_sequence_uint16_field; + m_unbounded_sequence_int32_field = x.m_unbounded_sequence_int32_field; + m_unbounded_sequence_uint32_field = x.m_unbounded_sequence_uint32_field; + m_unbounded_sequence_int64_field = x.m_unbounded_sequence_int64_field; + m_unbounded_sequence_uint64_field = x.m_unbounded_sequence_uint64_field; + m_unbounded_sequence_float_field = x.m_unbounded_sequence_float_field; + m_unbounded_sequence_double_field = x.m_unbounded_sequence_double_field; + m_unbounded_sequence_bool_field = x.m_unbounded_sequence_bool_field; + m_unbounded_sequence_enum_field = x.m_unbounded_sequence_enum_field; + m_unbounded_sequence_enum2_field = x.m_unbounded_sequence_enum2_field; + m_unbounded_sequence_struct_field = x.m_unbounded_sequence_struct_field; - dcdr >> m_array_int64_field; + return *this; +} - dcdr >> m_array_uint64_field; +KeyedCompleteTestType& KeyedCompleteTestType::operator =( + KeyedCompleteTestType&& x) noexcept +{ - dcdr >> m_array_float_field; + m_id = x.m_id; + m_char_field = x.m_char_field; + m_uint8_field = x.m_uint8_field; + m_int16_field = x.m_int16_field; + m_uint16_field = x.m_uint16_field; + m_int32_field = x.m_int32_field; + m_uint32_field = x.m_uint32_field; + m_int64_field = x.m_int64_field; + m_uint64_field = x.m_uint64_field; + m_float_field = x.m_float_field; + m_double_field = x.m_double_field; + m_bool_field = x.m_bool_field; + m_string_field = std::move(x.m_string_field); + m_enum_field = x.m_enum_field; + m_enum2_field = x.m_enum2_field; + m_struct_field = std::move(x.m_struct_field); + m_array_char_field = std::move(x.m_array_char_field); + m_array_uint8_field = std::move(x.m_array_uint8_field); + m_array_int16_field = std::move(x.m_array_int16_field); + m_array_uint16_field = std::move(x.m_array_uint16_field); + m_array_int32_field = std::move(x.m_array_int32_field); + m_array_uint32_field = std::move(x.m_array_uint32_field); + m_array_int64_field = std::move(x.m_array_int64_field); + m_array_uint64_field = std::move(x.m_array_uint64_field); + m_array_float_field = std::move(x.m_array_float_field); + m_array_double_field = std::move(x.m_array_double_field); + m_array_bool_field = std::move(x.m_array_bool_field); + m_array_enum_field = std::move(x.m_array_enum_field); + m_array_enum2_field = std::move(x.m_array_enum2_field); + m_array_struct_field = std::move(x.m_array_struct_field); + m_bounded_sequence_char_field = std::move(x.m_bounded_sequence_char_field); + m_bounded_sequence_uint8_field = std::move(x.m_bounded_sequence_uint8_field); + m_bounded_sequence_int16_field = std::move(x.m_bounded_sequence_int16_field); + m_bounded_sequence_uint16_field = std::move(x.m_bounded_sequence_uint16_field); + m_bounded_sequence_int32_field = std::move(x.m_bounded_sequence_int32_field); + m_bounded_sequence_uint32_field = std::move(x.m_bounded_sequence_uint32_field); + m_bounded_sequence_int64_field = std::move(x.m_bounded_sequence_int64_field); + m_bounded_sequence_uint64_field = std::move(x.m_bounded_sequence_uint64_field); + m_bounded_sequence_float_field = std::move(x.m_bounded_sequence_float_field); + m_bounded_sequence_double_field = std::move(x.m_bounded_sequence_double_field); + m_bounded_sequence_bool_field = std::move(x.m_bounded_sequence_bool_field); + m_bounded_sequence_enum_field = std::move(x.m_bounded_sequence_enum_field); + m_bounded_sequence_enum2_field = std::move(x.m_bounded_sequence_enum2_field); + m_bounded_sequence_struct_field = std::move(x.m_bounded_sequence_struct_field); + m_unbounded_sequence_char_field = std::move(x.m_unbounded_sequence_char_field); + m_unbounded_sequence_uint8_field = std::move(x.m_unbounded_sequence_uint8_field); + m_unbounded_sequence_int16_field = std::move(x.m_unbounded_sequence_int16_field); + m_unbounded_sequence_uint16_field = std::move(x.m_unbounded_sequence_uint16_field); + m_unbounded_sequence_int32_field = std::move(x.m_unbounded_sequence_int32_field); + m_unbounded_sequence_uint32_field = std::move(x.m_unbounded_sequence_uint32_field); + m_unbounded_sequence_int64_field = std::move(x.m_unbounded_sequence_int64_field); + m_unbounded_sequence_uint64_field = std::move(x.m_unbounded_sequence_uint64_field); + m_unbounded_sequence_float_field = std::move(x.m_unbounded_sequence_float_field); + m_unbounded_sequence_double_field = std::move(x.m_unbounded_sequence_double_field); + m_unbounded_sequence_bool_field = std::move(x.m_unbounded_sequence_bool_field); + m_unbounded_sequence_enum_field = std::move(x.m_unbounded_sequence_enum_field); + m_unbounded_sequence_enum2_field = std::move(x.m_unbounded_sequence_enum2_field); + m_unbounded_sequence_struct_field = std::move(x.m_unbounded_sequence_struct_field); - dcdr >> m_array_double_field; + return *this; +} - dcdr >> m_array_bool_field; - - dcdr.deserializeArray(reinterpret_cast(m_array_enum_field.data()), m_array_enum_field.size()); - - - dcdr.deserializeArray(reinterpret_cast(m_array_enum2_field.data()), m_array_enum2_field.size()); - - - dcdr >> m_array_struct_field; - - dcdr >> m_bounded_sequence_char_field; - dcdr >> m_bounded_sequence_uint8_field; - dcdr >> m_bounded_sequence_int16_field; - dcdr >> m_bounded_sequence_uint16_field; - dcdr >> m_bounded_sequence_int32_field; - dcdr >> m_bounded_sequence_uint32_field; - dcdr >> m_bounded_sequence_int64_field; - dcdr >> m_bounded_sequence_uint64_field; - dcdr >> m_bounded_sequence_float_field; - dcdr >> m_bounded_sequence_double_field; - dcdr >> m_bounded_sequence_bool_field; - { - uint32_t seq_length = 0; - dcdr >> seq_length; - m_bounded_sequence_enum_field.resize(seq_length); - dcdr.deserializeArray(reinterpret_cast(m_bounded_sequence_enum_field.data()), seq_length); - } - - { - uint32_t seq_length = 0; - dcdr >> seq_length; - m_bounded_sequence_enum2_field.resize(seq_length); - dcdr.deserializeArray(reinterpret_cast(m_bounded_sequence_enum2_field.data()), seq_length); - } +bool KeyedCompleteTestType::operator ==( + const KeyedCompleteTestType& x) const +{ + return (m_id == x.m_id && + m_char_field == x.m_char_field && + m_uint8_field == x.m_uint8_field && + m_int16_field == x.m_int16_field && + m_uint16_field == x.m_uint16_field && + m_int32_field == x.m_int32_field && + m_uint32_field == x.m_uint32_field && + m_int64_field == x.m_int64_field && + m_uint64_field == x.m_uint64_field && + m_float_field == x.m_float_field && + m_double_field == x.m_double_field && + m_bool_field == x.m_bool_field && + m_string_field == x.m_string_field && + m_enum_field == x.m_enum_field && + m_enum2_field == x.m_enum2_field && + m_struct_field == x.m_struct_field && + m_array_char_field == x.m_array_char_field && + m_array_uint8_field == x.m_array_uint8_field && + m_array_int16_field == x.m_array_int16_field && + m_array_uint16_field == x.m_array_uint16_field && + m_array_int32_field == x.m_array_int32_field && + m_array_uint32_field == x.m_array_uint32_field && + m_array_int64_field == x.m_array_int64_field && + m_array_uint64_field == x.m_array_uint64_field && + m_array_float_field == x.m_array_float_field && + m_array_double_field == x.m_array_double_field && + m_array_bool_field == x.m_array_bool_field && + m_array_enum_field == x.m_array_enum_field && + m_array_enum2_field == x.m_array_enum2_field && + m_array_struct_field == x.m_array_struct_field && + m_bounded_sequence_char_field == x.m_bounded_sequence_char_field && + m_bounded_sequence_uint8_field == x.m_bounded_sequence_uint8_field && + m_bounded_sequence_int16_field == x.m_bounded_sequence_int16_field && + m_bounded_sequence_uint16_field == x.m_bounded_sequence_uint16_field && + m_bounded_sequence_int32_field == x.m_bounded_sequence_int32_field && + m_bounded_sequence_uint32_field == x.m_bounded_sequence_uint32_field && + m_bounded_sequence_int64_field == x.m_bounded_sequence_int64_field && + m_bounded_sequence_uint64_field == x.m_bounded_sequence_uint64_field && + m_bounded_sequence_float_field == x.m_bounded_sequence_float_field && + m_bounded_sequence_double_field == x.m_bounded_sequence_double_field && + m_bounded_sequence_bool_field == x.m_bounded_sequence_bool_field && + m_bounded_sequence_enum_field == x.m_bounded_sequence_enum_field && + m_bounded_sequence_enum2_field == x.m_bounded_sequence_enum2_field && + m_bounded_sequence_struct_field == x.m_bounded_sequence_struct_field && + m_unbounded_sequence_char_field == x.m_unbounded_sequence_char_field && + m_unbounded_sequence_uint8_field == x.m_unbounded_sequence_uint8_field && + m_unbounded_sequence_int16_field == x.m_unbounded_sequence_int16_field && + m_unbounded_sequence_uint16_field == x.m_unbounded_sequence_uint16_field && + m_unbounded_sequence_int32_field == x.m_unbounded_sequence_int32_field && + m_unbounded_sequence_uint32_field == x.m_unbounded_sequence_uint32_field && + m_unbounded_sequence_int64_field == x.m_unbounded_sequence_int64_field && + m_unbounded_sequence_uint64_field == x.m_unbounded_sequence_uint64_field && + m_unbounded_sequence_float_field == x.m_unbounded_sequence_float_field && + m_unbounded_sequence_double_field == x.m_unbounded_sequence_double_field && + m_unbounded_sequence_bool_field == x.m_unbounded_sequence_bool_field && + m_unbounded_sequence_enum_field == x.m_unbounded_sequence_enum_field && + m_unbounded_sequence_enum2_field == x.m_unbounded_sequence_enum2_field && + m_unbounded_sequence_struct_field == x.m_unbounded_sequence_struct_field); +} - dcdr >> m_bounded_sequence_struct_field; - dcdr >> m_unbounded_sequence_char_field; - dcdr >> m_unbounded_sequence_uint8_field; - dcdr >> m_unbounded_sequence_int16_field; - dcdr >> m_unbounded_sequence_uint16_field; - dcdr >> m_unbounded_sequence_int32_field; - dcdr >> m_unbounded_sequence_uint32_field; - dcdr >> m_unbounded_sequence_int64_field; - dcdr >> m_unbounded_sequence_uint64_field; - dcdr >> m_unbounded_sequence_float_field; - dcdr >> m_unbounded_sequence_double_field; - dcdr >> m_unbounded_sequence_bool_field; - { - uint32_t seq_length = 0; - dcdr >> seq_length; - m_unbounded_sequence_enum_field.resize(seq_length); - dcdr.deserializeArray(reinterpret_cast(m_unbounded_sequence_enum_field.data()), seq_length); - } - - { - uint32_t seq_length = 0; - dcdr >> seq_length; - m_unbounded_sequence_enum2_field.resize(seq_length); - dcdr.deserializeArray(reinterpret_cast(m_unbounded_sequence_enum2_field.data()), seq_length); - } - - dcdr >> m_unbounded_sequence_struct_field; +bool KeyedCompleteTestType::operator !=( + const KeyedCompleteTestType& x) const +{ + return !(*this == x); } /*! @@ -4757,6 +3358,7 @@ int32_t& KeyedCompleteTestType::id() return m_id; } + /*! * @brief This function sets a value in member char_field * @param _char_field New value for member char_field @@ -4785,6 +3387,7 @@ char& KeyedCompleteTestType::char_field() return m_char_field; } + /*! * @brief This function sets a value in member uint8_field * @param _uint8_field New value for member uint8_field @@ -4813,6 +3416,7 @@ uint8_t& KeyedCompleteTestType::uint8_field() return m_uint8_field; } + /*! * @brief This function sets a value in member int16_field * @param _int16_field New value for member int16_field @@ -4841,6 +3445,7 @@ int16_t& KeyedCompleteTestType::int16_field() return m_int16_field; } + /*! * @brief This function sets a value in member uint16_field * @param _uint16_field New value for member uint16_field @@ -4869,6 +3474,7 @@ uint16_t& KeyedCompleteTestType::uint16_field() return m_uint16_field; } + /*! * @brief This function sets a value in member int32_field * @param _int32_field New value for member int32_field @@ -4897,6 +3503,7 @@ int32_t& KeyedCompleteTestType::int32_field() return m_int32_field; } + /*! * @brief This function sets a value in member uint32_field * @param _uint32_field New value for member uint32_field @@ -4925,6 +3532,7 @@ uint32_t& KeyedCompleteTestType::uint32_field() return m_uint32_field; } + /*! * @brief This function sets a value in member int64_field * @param _int64_field New value for member int64_field @@ -4953,6 +3561,7 @@ int64_t& KeyedCompleteTestType::int64_field() return m_int64_field; } + /*! * @brief This function sets a value in member uint64_field * @param _uint64_field New value for member uint64_field @@ -4981,6 +3590,7 @@ uint64_t& KeyedCompleteTestType::uint64_field() return m_uint64_field; } + /*! * @brief This function sets a value in member float_field * @param _float_field New value for member float_field @@ -5009,6 +3619,7 @@ float& KeyedCompleteTestType::float_field() return m_float_field; } + /*! * @brief This function sets a value in member double_field * @param _double_field New value for member double_field @@ -5037,6 +3648,7 @@ double& KeyedCompleteTestType::double_field() return m_double_field; } + /*! * @brief This function sets a value in member bool_field * @param _bool_field New value for member bool_field @@ -5065,6 +3677,7 @@ bool& KeyedCompleteTestType::bool_field() return m_bool_field; } + /*! * @brief This function copies the value in member string_field * @param _string_field New value to be copied in member string_field @@ -5102,6 +3715,8 @@ std::string& KeyedCompleteTestType::string_field() { return m_string_field; } + + /*! * @brief This function sets a value in member enum_field * @param _enum_field New value for member enum_field @@ -5130,6 +3745,7 @@ Color& KeyedCompleteTestType::enum_field() return m_enum_field; } + /*! * @brief This function sets a value in member enum2_field * @param _enum2_field New value for member enum2_field @@ -5158,6 +3774,7 @@ Material& KeyedCompleteTestType::enum2_field() return m_enum2_field; } + /*! * @brief This function copies the value in member struct_field * @param _struct_field New value to be copied in member struct_field @@ -5195,6 +3812,8 @@ StructType& KeyedCompleteTestType::struct_field() { return m_struct_field; } + + /*! * @brief This function copies the value in member array_char_field * @param _array_char_field New value to be copied in member array_char_field @@ -5232,6 +3851,8 @@ std::array& KeyedCompleteTestType::array_char_field() { return m_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 @@ -5269,6 +3890,8 @@ std::array& KeyedCompleteTestType::array_uint8_field() { return m_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 @@ -5306,6 +3929,8 @@ std::array& KeyedCompleteTestType::array_int16_field() { return m_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 @@ -5343,6 +3968,8 @@ std::array& KeyedCompleteTestType::array_uint16_field() { return m_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 @@ -5380,6 +4007,8 @@ std::array& KeyedCompleteTestType::array_int32_field() { return m_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 @@ -5417,6 +4046,8 @@ std::array& KeyedCompleteTestType::array_uint32_field() { return m_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 @@ -5454,6 +4085,8 @@ std::array& KeyedCompleteTestType::array_int64_field() { return m_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 @@ -5491,6 +4124,8 @@ std::array& KeyedCompleteTestType::array_uint64_field() { return m_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 @@ -5528,6 +4163,8 @@ std::array& KeyedCompleteTestType::array_float_field() { return m_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 @@ -5565,6 +4202,8 @@ std::array& KeyedCompleteTestType::array_double_field() { return m_array_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 @@ -5602,6 +4241,8 @@ std::array& KeyedCompleteTestType::array_bool_field() { return m_array_bool_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 @@ -5639,6 +4280,8 @@ std::array& KeyedCompleteTestType::array_enum_field() { return m_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 @@ -5676,6 +4319,8 @@ std::array& KeyedCompleteTestType::array_enum2_field() { return m_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 @@ -5713,6 +4358,8 @@ std::array& KeyedCompleteTestType::array_struct_field() { return m_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 @@ -5750,6 +4397,8 @@ std::vector& KeyedCompleteTestType::bounded_sequence_char_field() { return m_bounded_sequence_char_field; } + + /*! * @brief This function copies the value in member bounded_sequence_uint8_field * @param _bounded_sequence_uint8_field New value to be copied in member bounded_sequence_uint8_field @@ -5787,6 +4436,8 @@ std::vector& KeyedCompleteTestType::bounded_sequence_uint8_field() { return m_bounded_sequence_uint8_field; } + + /*! * @brief This function copies the value in member bounded_sequence_int16_field * @param _bounded_sequence_int16_field New value to be copied in member bounded_sequence_int16_field @@ -5824,6 +4475,8 @@ std::vector& KeyedCompleteTestType::bounded_sequence_int16_field() { return m_bounded_sequence_int16_field; } + + /*! * @brief This function copies the value in member bounded_sequence_uint16_field * @param _bounded_sequence_uint16_field New value to be copied in member bounded_sequence_uint16_field @@ -5861,6 +4514,8 @@ std::vector& KeyedCompleteTestType::bounded_sequence_uint16_field() { return m_bounded_sequence_uint16_field; } + + /*! * @brief This function copies the value in member bounded_sequence_int32_field * @param _bounded_sequence_int32_field New value to be copied in member bounded_sequence_int32_field @@ -5898,6 +4553,8 @@ std::vector& KeyedCompleteTestType::bounded_sequence_int32_field() { return m_bounded_sequence_int32_field; } + + /*! * @brief This function copies the value in member bounded_sequence_uint32_field * @param _bounded_sequence_uint32_field New value to be copied in member bounded_sequence_uint32_field @@ -5935,6 +4592,8 @@ std::vector& KeyedCompleteTestType::bounded_sequence_uint32_field() { return m_bounded_sequence_uint32_field; } + + /*! * @brief This function copies the value in member bounded_sequence_int64_field * @param _bounded_sequence_int64_field New value to be copied in member bounded_sequence_int64_field @@ -5972,6 +4631,8 @@ std::vector& KeyedCompleteTestType::bounded_sequence_int64_field() { return m_bounded_sequence_int64_field; } + + /*! * @brief This function copies the value in member bounded_sequence_uint64_field * @param _bounded_sequence_uint64_field New value to be copied in member bounded_sequence_uint64_field @@ -6009,6 +4670,8 @@ std::vector& KeyedCompleteTestType::bounded_sequence_uint64_field() { return m_bounded_sequence_uint64_field; } + + /*! * @brief This function copies the value in member bounded_sequence_float_field * @param _bounded_sequence_float_field New value to be copied in member bounded_sequence_float_field @@ -6046,6 +4709,8 @@ std::vector& KeyedCompleteTestType::bounded_sequence_float_field() { return m_bounded_sequence_float_field; } + + /*! * @brief This function copies the value in member bounded_sequence_double_field * @param _bounded_sequence_double_field New value to be copied in member bounded_sequence_double_field @@ -6083,6 +4748,8 @@ std::vector& KeyedCompleteTestType::bounded_sequence_double_field() { return m_bounded_sequence_double_field; } + + /*! * @brief This function copies the value in member bounded_sequence_bool_field * @param _bounded_sequence_bool_field New value to be copied in member bounded_sequence_bool_field @@ -6120,6 +4787,8 @@ std::vector& KeyedCompleteTestType::bounded_sequence_bool_field() { return m_bounded_sequence_bool_field; } + + /*! * @brief This function copies the value in member bounded_sequence_enum_field * @param _bounded_sequence_enum_field New value to be copied in member bounded_sequence_enum_field @@ -6157,6 +4826,8 @@ std::vector& KeyedCompleteTestType::bounded_sequence_enum_field() { return m_bounded_sequence_enum_field; } + + /*! * @brief This function copies the value in member bounded_sequence_enum2_field * @param _bounded_sequence_enum2_field New value to be copied in member bounded_sequence_enum2_field @@ -6194,6 +4865,8 @@ std::vector& KeyedCompleteTestType::bounded_sequence_enum2_field() { return m_bounded_sequence_enum2_field; } + + /*! * @brief This function copies the value in member bounded_sequence_struct_field * @param _bounded_sequence_struct_field New value to be copied in member bounded_sequence_struct_field @@ -6231,6 +4904,8 @@ std::vector& KeyedCompleteTestType::bounded_sequence_struct_field() { return m_bounded_sequence_struct_field; } + + /*! * @brief This function copies the value in member unbounded_sequence_char_field * @param _unbounded_sequence_char_field New value to be copied in member unbounded_sequence_char_field @@ -6268,6 +4943,8 @@ std::vector& KeyedCompleteTestType::unbounded_sequence_char_field() { return m_unbounded_sequence_char_field; } + + /*! * @brief This function copies the value in member unbounded_sequence_uint8_field * @param _unbounded_sequence_uint8_field New value to be copied in member unbounded_sequence_uint8_field @@ -6305,6 +4982,8 @@ std::vector& KeyedCompleteTestType::unbounded_sequence_uint8_field() { return m_unbounded_sequence_uint8_field; } + + /*! * @brief This function copies the value in member unbounded_sequence_int16_field * @param _unbounded_sequence_int16_field New value to be copied in member unbounded_sequence_int16_field @@ -6342,6 +5021,8 @@ std::vector& KeyedCompleteTestType::unbounded_sequence_int16_field() { return m_unbounded_sequence_int16_field; } + + /*! * @brief This function copies the value in member unbounded_sequence_uint16_field * @param _unbounded_sequence_uint16_field New value to be copied in member unbounded_sequence_uint16_field @@ -6379,6 +5060,8 @@ std::vector& KeyedCompleteTestType::unbounded_sequence_uint16_field() { return m_unbounded_sequence_uint16_field; } + + /*! * @brief This function copies the value in member unbounded_sequence_int32_field * @param _unbounded_sequence_int32_field New value to be copied in member unbounded_sequence_int32_field @@ -6416,6 +5099,8 @@ std::vector& KeyedCompleteTestType::unbounded_sequence_int32_field() { return m_unbounded_sequence_int32_field; } + + /*! * @brief This function copies the value in member unbounded_sequence_uint32_field * @param _unbounded_sequence_uint32_field New value to be copied in member unbounded_sequence_uint32_field @@ -6453,6 +5138,8 @@ std::vector& KeyedCompleteTestType::unbounded_sequence_uint32_field() { return m_unbounded_sequence_uint32_field; } + + /*! * @brief This function copies the value in member unbounded_sequence_int64_field * @param _unbounded_sequence_int64_field New value to be copied in member unbounded_sequence_int64_field @@ -6490,6 +5177,8 @@ std::vector& KeyedCompleteTestType::unbounded_sequence_int64_field() { return m_unbounded_sequence_int64_field; } + + /*! * @brief This function copies the value in member unbounded_sequence_uint64_field * @param _unbounded_sequence_uint64_field New value to be copied in member unbounded_sequence_uint64_field @@ -6527,6 +5216,8 @@ std::vector& KeyedCompleteTestType::unbounded_sequence_uint64_field() { return m_unbounded_sequence_uint64_field; } + + /*! * @brief This function copies the value in member unbounded_sequence_float_field * @param _unbounded_sequence_float_field New value to be copied in member unbounded_sequence_float_field @@ -6564,6 +5255,8 @@ std::vector& KeyedCompleteTestType::unbounded_sequence_float_field() { return m_unbounded_sequence_float_field; } + + /*! * @brief This function copies the value in member unbounded_sequence_double_field * @param _unbounded_sequence_double_field New value to be copied in member unbounded_sequence_double_field @@ -6601,6 +5294,8 @@ std::vector& KeyedCompleteTestType::unbounded_sequence_double_field() { return m_unbounded_sequence_double_field; } + + /*! * @brief This function copies the value in member unbounded_sequence_bool_field * @param _unbounded_sequence_bool_field New value to be copied in member unbounded_sequence_bool_field @@ -6638,6 +5333,8 @@ std::vector& KeyedCompleteTestType::unbounded_sequence_bool_field() { return m_unbounded_sequence_bool_field; } + + /*! * @brief This function copies the value in member unbounded_sequence_enum_field * @param _unbounded_sequence_enum_field New value to be copied in member unbounded_sequence_enum_field @@ -6675,6 +5372,8 @@ std::vector& KeyedCompleteTestType::unbounded_sequence_enum_field() { return m_unbounded_sequence_enum_field; } + + /*! * @brief This function copies the value in member unbounded_sequence_enum2_field * @param _unbounded_sequence_enum2_field New value to be copied in member unbounded_sequence_enum2_field @@ -6712,6 +5411,8 @@ std::vector& KeyedCompleteTestType::unbounded_sequence_enum2_field() { return m_unbounded_sequence_enum2_field; } + + /*! * @brief This function copies the value in member unbounded_sequence_struct_field * @param _unbounded_sequence_struct_field New value to be copied in member unbounded_sequence_struct_field @@ -6751,80 +5452,5 @@ std::vector& KeyedCompleteTestType::unbounded_sequence_struct_field( } -size_t KeyedCompleteTestType::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return KeyedCompleteTestType_max_key_cdr_typesize; -} - -bool KeyedCompleteTestType::isKeyDefined() -{ - return true; -} - -void KeyedCompleteTestType::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - scdr << m_id; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -} - +// Include auxiliary functions like for serializing/deserializing. +#include "test_completeCdrAux.ipp" diff --git a/fastdds_python/test/types/test_complete.h b/fastdds_python/test/types/test_complete.h index 1f7a2c98..e3465362 100644 --- a/fastdds_python/test/types/test_complete.h +++ b/fastdds_python/test/types/test_complete.h @@ -16,21 +16,23 @@ * @file test_complete.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen. */ #ifndef _FAST_DDS_GENERATED_TEST_COMPLETE_H_ #define _FAST_DDS_GENERATED_TEST_COMPLETE_H_ - -#include - -#include #include +#include +#include +#include #include #include -#include -#include + +#include +#include + + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -59,10 +61,12 @@ namespace eprosima { namespace fastcdr { class Cdr; +class CdrSizeCalculator; } // namespace fastcdr } // namespace eprosima + /*! * @brief This class represents the enumeration Color defined by the user in the IDL file. * @ingroup test_complete @@ -166,6 +170,7 @@ class StructType */ eProsima_user_DllExport char& char_field(); + /*! * @brief This function sets a value in member uint8_field * @param _uint8_field New value for member uint8_field @@ -185,6 +190,7 @@ class StructType */ eProsima_user_DllExport uint8_t& uint8_field(); + /*! * @brief This function sets a value in member int16_field * @param _int16_field New value for member int16_field @@ -204,6 +210,7 @@ class StructType */ eProsima_user_DllExport int16_t& int16_field(); + /*! * @brief This function sets a value in member uint16_field * @param _uint16_field New value for member uint16_field @@ -223,6 +230,7 @@ class StructType */ eProsima_user_DllExport uint16_t& uint16_field(); + /*! * @brief This function sets a value in member int32_field * @param _int32_field New value for member int32_field @@ -242,6 +250,7 @@ class StructType */ eProsima_user_DllExport int32_t& int32_field(); + /*! * @brief This function sets a value in member uint32_field * @param _uint32_field New value for member uint32_field @@ -261,6 +270,7 @@ class StructType */ eProsima_user_DllExport uint32_t& uint32_field(); + /*! * @brief This function sets a value in member int64_field * @param _int64_field New value for member int64_field @@ -280,6 +290,7 @@ class StructType */ eProsima_user_DllExport int64_t& int64_field(); + /*! * @brief This function sets a value in member uint64_field * @param _uint64_field New value for member uint64_field @@ -299,6 +310,7 @@ class StructType */ eProsima_user_DllExport uint64_t& uint64_field(); + /*! * @brief This function sets a value in member float_field * @param _float_field New value for member float_field @@ -318,6 +330,7 @@ class StructType */ eProsima_user_DllExport float& float_field(); + /*! * @brief This function sets a value in member double_field * @param _double_field New value for member double_field @@ -337,6 +350,7 @@ class StructType */ eProsima_user_DllExport double& double_field(); + /*! * @brief This function sets a value in member bool_field * @param _bool_field New value for member bool_field @@ -356,6 +370,7 @@ class StructType */ eProsima_user_DllExport bool& bool_field(); + /*! * @brief This function copies the value in member string_field * @param _string_field New value to be copied in member string_field @@ -381,6 +396,8 @@ class StructType * @return Reference to member string_field */ eProsima_user_DllExport std::string& string_field(); + + /*! * @brief This function sets a value in member enum_field * @param _enum_field New value for member enum_field @@ -400,6 +417,7 @@ class StructType */ eProsima_user_DllExport Color& enum_field(); + /*! * @brief This function sets a value in member enum2_field * @param _enum2_field New value for member enum2_field @@ -419,80 +437,22 @@ class StructType */ eProsima_user_DllExport Material& enum2_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. - */ - 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. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const StructType& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - private: - char m_char_field; - uint8_t m_uint8_field; - int16_t m_int16_field; - uint16_t m_uint16_field; - int32_t m_int32_field; - uint32_t m_uint32_field; - int64_t m_int64_field; - uint64_t m_uint64_field; - float m_float_field; - double m_double_field; - bool m_bool_field; + char m_char_field{0}; + uint8_t m_uint8_field{0}; + int16_t m_int16_field{0}; + uint16_t m_uint16_field{0}; + int32_t m_int32_field{0}; + uint32_t m_uint32_field{0}; + int64_t m_int64_field{0}; + uint64_t m_uint64_field{0}; + float m_float_field{0.0}; + double m_double_field{0.0}; + bool m_bool_field{false}; std::string m_string_field; - Color m_enum_field; - Material m_enum2_field; + Color m_enum_field{::RED}; + Material m_enum2_field{::WOOD}; }; const uint32_t max_array_size = 3; @@ -576,6 +536,7 @@ class CompleteTestType */ eProsima_user_DllExport char& char_field(); + /*! * @brief This function sets a value in member uint8_field * @param _uint8_field New value for member uint8_field @@ -595,6 +556,7 @@ class CompleteTestType */ eProsima_user_DllExport uint8_t& uint8_field(); + /*! * @brief This function sets a value in member int16_field * @param _int16_field New value for member int16_field @@ -614,6 +576,7 @@ class CompleteTestType */ eProsima_user_DllExport int16_t& int16_field(); + /*! * @brief This function sets a value in member uint16_field * @param _uint16_field New value for member uint16_field @@ -633,6 +596,7 @@ class CompleteTestType */ eProsima_user_DllExport uint16_t& uint16_field(); + /*! * @brief This function sets a value in member int32_field * @param _int32_field New value for member int32_field @@ -652,6 +616,7 @@ class CompleteTestType */ eProsima_user_DllExport int32_t& int32_field(); + /*! * @brief This function sets a value in member uint32_field * @param _uint32_field New value for member uint32_field @@ -671,6 +636,7 @@ class CompleteTestType */ eProsima_user_DllExport uint32_t& uint32_field(); + /*! * @brief This function sets a value in member int64_field * @param _int64_field New value for member int64_field @@ -690,6 +656,7 @@ class CompleteTestType */ eProsima_user_DllExport int64_t& int64_field(); + /*! * @brief This function sets a value in member uint64_field * @param _uint64_field New value for member uint64_field @@ -709,6 +676,7 @@ class CompleteTestType */ eProsima_user_DllExport uint64_t& uint64_field(); + /*! * @brief This function sets a value in member float_field * @param _float_field New value for member float_field @@ -728,6 +696,7 @@ class CompleteTestType */ eProsima_user_DllExport float& float_field(); + /*! * @brief This function sets a value in member double_field * @param _double_field New value for member double_field @@ -747,6 +716,7 @@ class CompleteTestType */ eProsima_user_DllExport double& double_field(); + /*! * @brief This function sets a value in member bool_field * @param _bool_field New value for member bool_field @@ -766,6 +736,7 @@ class CompleteTestType */ eProsima_user_DllExport bool& bool_field(); + /*! * @brief This function copies the value in member string_field * @param _string_field New value to be copied in member string_field @@ -791,6 +762,8 @@ class CompleteTestType * @return Reference to member string_field */ eProsima_user_DllExport std::string& string_field(); + + /*! * @brief This function sets a value in member enum_field * @param _enum_field New value for member enum_field @@ -810,6 +783,7 @@ class CompleteTestType */ eProsima_user_DllExport Color& enum_field(); + /*! * @brief This function sets a value in member enum2_field * @param _enum2_field New value for member enum2_field @@ -829,6 +803,7 @@ class CompleteTestType */ eProsima_user_DllExport Material& enum2_field(); + /*! * @brief This function copies the value in member struct_field * @param _struct_field New value to be copied in member struct_field @@ -854,6 +829,8 @@ class CompleteTestType * @return Reference to member struct_field */ eProsima_user_DllExport StructType& struct_field(); + + /*! * @brief This function copies the value in member array_char_field * @param _array_char_field New value to be copied in member array_char_field @@ -879,6 +856,8 @@ class CompleteTestType * @return Reference to member 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 @@ -904,6 +883,8 @@ class CompleteTestType * @return Reference to member 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 @@ -929,6 +910,8 @@ class CompleteTestType * @return Reference to member 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 @@ -954,6 +937,8 @@ class CompleteTestType * @return Reference to member 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 @@ -979,6 +964,8 @@ class CompleteTestType * @return Reference to member 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 @@ -1004,6 +991,8 @@ class CompleteTestType * @return Reference to member 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 @@ -1029,6 +1018,8 @@ class CompleteTestType * @return Reference to member 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 @@ -1054,6 +1045,8 @@ class CompleteTestType * @return Reference to member 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 @@ -1079,6 +1072,8 @@ class CompleteTestType * @return Reference to member 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 @@ -1104,6 +1099,8 @@ class CompleteTestType * @return Reference to member array_double_field */ eProsima_user_DllExport std::array& array_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 @@ -1129,6 +1126,8 @@ class CompleteTestType * @return Reference to member array_bool_field */ eProsima_user_DllExport std::array& array_bool_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 @@ -1154,6 +1153,8 @@ class CompleteTestType * @return Reference to member 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 @@ -1179,6 +1180,8 @@ class CompleteTestType * @return Reference to member 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 @@ -1204,6 +1207,8 @@ class CompleteTestType * @return Reference to member 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 @@ -1229,6 +1234,8 @@ class CompleteTestType * @return Reference to member bounded_sequence_char_field */ eProsima_user_DllExport std::vector& bounded_sequence_char_field(); + + /*! * @brief This function copies the value in member bounded_sequence_uint8_field * @param _bounded_sequence_uint8_field New value to be copied in member bounded_sequence_uint8_field @@ -1254,6 +1261,8 @@ class CompleteTestType * @return Reference to member bounded_sequence_uint8_field */ eProsima_user_DllExport std::vector& bounded_sequence_uint8_field(); + + /*! * @brief This function copies the value in member bounded_sequence_int16_field * @param _bounded_sequence_int16_field New value to be copied in member bounded_sequence_int16_field @@ -1279,6 +1288,8 @@ class CompleteTestType * @return Reference to member bounded_sequence_int16_field */ eProsima_user_DllExport std::vector& bounded_sequence_int16_field(); + + /*! * @brief This function copies the value in member bounded_sequence_uint16_field * @param _bounded_sequence_uint16_field New value to be copied in member bounded_sequence_uint16_field @@ -1304,6 +1315,8 @@ class CompleteTestType * @return Reference to member bounded_sequence_uint16_field */ eProsima_user_DllExport std::vector& bounded_sequence_uint16_field(); + + /*! * @brief This function copies the value in member bounded_sequence_int32_field * @param _bounded_sequence_int32_field New value to be copied in member bounded_sequence_int32_field @@ -1329,6 +1342,8 @@ class CompleteTestType * @return Reference to member bounded_sequence_int32_field */ eProsima_user_DllExport std::vector& bounded_sequence_int32_field(); + + /*! * @brief This function copies the value in member bounded_sequence_uint32_field * @param _bounded_sequence_uint32_field New value to be copied in member bounded_sequence_uint32_field @@ -1354,6 +1369,8 @@ class CompleteTestType * @return Reference to member bounded_sequence_uint32_field */ eProsima_user_DllExport std::vector& bounded_sequence_uint32_field(); + + /*! * @brief This function copies the value in member bounded_sequence_int64_field * @param _bounded_sequence_int64_field New value to be copied in member bounded_sequence_int64_field @@ -1379,6 +1396,8 @@ class CompleteTestType * @return Reference to member bounded_sequence_int64_field */ eProsima_user_DllExport std::vector& bounded_sequence_int64_field(); + + /*! * @brief This function copies the value in member bounded_sequence_uint64_field * @param _bounded_sequence_uint64_field New value to be copied in member bounded_sequence_uint64_field @@ -1404,6 +1423,8 @@ class CompleteTestType * @return Reference to member bounded_sequence_uint64_field */ eProsima_user_DllExport std::vector& bounded_sequence_uint64_field(); + + /*! * @brief This function copies the value in member bounded_sequence_float_field * @param _bounded_sequence_float_field New value to be copied in member bounded_sequence_float_field @@ -1429,6 +1450,8 @@ class CompleteTestType * @return Reference to member bounded_sequence_float_field */ eProsima_user_DllExport std::vector& bounded_sequence_float_field(); + + /*! * @brief This function copies the value in member bounded_sequence_double_field * @param _bounded_sequence_double_field New value to be copied in member bounded_sequence_double_field @@ -1454,6 +1477,8 @@ class CompleteTestType * @return Reference to member bounded_sequence_double_field */ eProsima_user_DllExport std::vector& bounded_sequence_double_field(); + + /*! * @brief This function copies the value in member bounded_sequence_bool_field * @param _bounded_sequence_bool_field New value to be copied in member bounded_sequence_bool_field @@ -1479,6 +1504,8 @@ class CompleteTestType * @return Reference to member bounded_sequence_bool_field */ eProsima_user_DllExport std::vector& bounded_sequence_bool_field(); + + /*! * @brief This function copies the value in member bounded_sequence_enum_field * @param _bounded_sequence_enum_field New value to be copied in member bounded_sequence_enum_field @@ -1504,6 +1531,8 @@ class CompleteTestType * @return Reference to member bounded_sequence_enum_field */ eProsima_user_DllExport std::vector& bounded_sequence_enum_field(); + + /*! * @brief This function copies the value in member bounded_sequence_enum2_field * @param _bounded_sequence_enum2_field New value to be copied in member bounded_sequence_enum2_field @@ -1529,6 +1558,8 @@ class CompleteTestType * @return Reference to member bounded_sequence_enum2_field */ eProsima_user_DllExport std::vector& bounded_sequence_enum2_field(); + + /*! * @brief This function copies the value in member bounded_sequence_struct_field * @param _bounded_sequence_struct_field New value to be copied in member bounded_sequence_struct_field @@ -1554,6 +1585,8 @@ class CompleteTestType * @return Reference to member bounded_sequence_struct_field */ eProsima_user_DllExport std::vector& bounded_sequence_struct_field(); + + /*! * @brief This function copies the value in member unbounded_sequence_char_field * @param _unbounded_sequence_char_field New value to be copied in member unbounded_sequence_char_field @@ -1579,6 +1612,8 @@ class CompleteTestType * @return Reference to member unbounded_sequence_char_field */ eProsima_user_DllExport std::vector& unbounded_sequence_char_field(); + + /*! * @brief This function copies the value in member unbounded_sequence_uint8_field * @param _unbounded_sequence_uint8_field New value to be copied in member unbounded_sequence_uint8_field @@ -1604,6 +1639,8 @@ class CompleteTestType * @return Reference to member unbounded_sequence_uint8_field */ eProsima_user_DllExport std::vector& unbounded_sequence_uint8_field(); + + /*! * @brief This function copies the value in member unbounded_sequence_int16_field * @param _unbounded_sequence_int16_field New value to be copied in member unbounded_sequence_int16_field @@ -1629,6 +1666,8 @@ class CompleteTestType * @return Reference to member unbounded_sequence_int16_field */ eProsima_user_DllExport std::vector& unbounded_sequence_int16_field(); + + /*! * @brief This function copies the value in member unbounded_sequence_uint16_field * @param _unbounded_sequence_uint16_field New value to be copied in member unbounded_sequence_uint16_field @@ -1654,6 +1693,8 @@ class CompleteTestType * @return Reference to member unbounded_sequence_uint16_field */ eProsima_user_DllExport std::vector& unbounded_sequence_uint16_field(); + + /*! * @brief This function copies the value in member unbounded_sequence_int32_field * @param _unbounded_sequence_int32_field New value to be copied in member unbounded_sequence_int32_field @@ -1679,6 +1720,8 @@ class CompleteTestType * @return Reference to member unbounded_sequence_int32_field */ eProsima_user_DllExport std::vector& unbounded_sequence_int32_field(); + + /*! * @brief This function copies the value in member unbounded_sequence_uint32_field * @param _unbounded_sequence_uint32_field New value to be copied in member unbounded_sequence_uint32_field @@ -1704,6 +1747,8 @@ class CompleteTestType * @return Reference to member unbounded_sequence_uint32_field */ eProsima_user_DllExport std::vector& unbounded_sequence_uint32_field(); + + /*! * @brief This function copies the value in member unbounded_sequence_int64_field * @param _unbounded_sequence_int64_field New value to be copied in member unbounded_sequence_int64_field @@ -1729,6 +1774,8 @@ class CompleteTestType * @return Reference to member unbounded_sequence_int64_field */ eProsima_user_DllExport std::vector& unbounded_sequence_int64_field(); + + /*! * @brief This function copies the value in member unbounded_sequence_uint64_field * @param _unbounded_sequence_uint64_field New value to be copied in member unbounded_sequence_uint64_field @@ -1754,6 +1801,8 @@ class CompleteTestType * @return Reference to member unbounded_sequence_uint64_field */ eProsima_user_DllExport std::vector& unbounded_sequence_uint64_field(); + + /*! * @brief This function copies the value in member unbounded_sequence_float_field * @param _unbounded_sequence_float_field New value to be copied in member unbounded_sequence_float_field @@ -1779,6 +1828,8 @@ class CompleteTestType * @return Reference to member unbounded_sequence_float_field */ eProsima_user_DllExport std::vector& unbounded_sequence_float_field(); + + /*! * @brief This function copies the value in member unbounded_sequence_double_field * @param _unbounded_sequence_double_field New value to be copied in member unbounded_sequence_double_field @@ -1804,6 +1855,8 @@ class CompleteTestType * @return Reference to member unbounded_sequence_double_field */ eProsima_user_DllExport std::vector& unbounded_sequence_double_field(); + + /*! * @brief This function copies the value in member unbounded_sequence_bool_field * @param _unbounded_sequence_bool_field New value to be copied in member unbounded_sequence_bool_field @@ -1829,6 +1882,8 @@ class CompleteTestType * @return Reference to member unbounded_sequence_bool_field */ eProsima_user_DllExport std::vector& unbounded_sequence_bool_field(); + + /*! * @brief This function copies the value in member unbounded_sequence_enum_field * @param _unbounded_sequence_enum_field New value to be copied in member unbounded_sequence_enum_field @@ -1854,6 +1909,8 @@ class CompleteTestType * @return Reference to member unbounded_sequence_enum_field */ eProsima_user_DllExport std::vector& unbounded_sequence_enum_field(); + + /*! * @brief This function copies the value in member unbounded_sequence_enum2_field * @param _unbounded_sequence_enum2_field New value to be copied in member unbounded_sequence_enum2_field @@ -1879,6 +1936,8 @@ class CompleteTestType * @return Reference to member unbounded_sequence_enum2_field */ eProsima_user_DllExport std::vector& unbounded_sequence_enum2_field(); + + /*! * @brief This function copies the value in member unbounded_sequence_struct_field * @param _unbounded_sequence_struct_field New value to be copied in member unbounded_sequence_struct_field @@ -1905,93 +1964,36 @@ class CompleteTestType */ 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. - */ - 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. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const CompleteTestType& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - private: - char m_char_field; - uint8_t m_uint8_field; - int16_t m_int16_field; - uint16_t m_uint16_field; - int32_t m_int32_field; - uint32_t m_uint32_field; - int64_t m_int64_field; - uint64_t m_uint64_field; - float m_float_field; - double m_double_field; - bool m_bool_field; + char m_char_field{0}; + uint8_t m_uint8_field{0}; + int16_t m_int16_field{0}; + uint16_t m_uint16_field{0}; + int32_t m_int32_field{0}; + uint32_t m_uint32_field{0}; + int64_t m_int64_field{0}; + uint64_t m_uint64_field{0}; + float m_float_field{0.0}; + double m_double_field{0.0}; + bool m_bool_field{false}; std::string m_string_field; - Color m_enum_field; - Material m_enum2_field; + Color m_enum_field{::RED}; + Material m_enum2_field{::WOOD}; 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_bool_field; - std::array m_array_enum_field; - std::array m_array_enum2_field; + std::array m_array_char_field{0}; + std::array m_array_uint8_field{0}; + std::array m_array_int16_field{0}; + std::array m_array_uint16_field{0}; + std::array m_array_int32_field{0}; + std::array m_array_uint32_field{0}; + std::array m_array_int64_field{0}; + std::array m_array_uint64_field{0}; + std::array m_array_float_field{0.0}; + std::array m_array_double_field{0.0}; + std::array m_array_bool_field{false}; + std::array m_array_enum_field{::RED}; + std::array m_array_enum2_field{::WOOD}; std::array m_array_struct_field; std::vector m_bounded_sequence_char_field; std::vector m_bounded_sequence_uint8_field; @@ -2102,6 +2104,7 @@ class KeyedCompleteTestType */ eProsima_user_DllExport int32_t& id(); + /*! * @brief This function sets a value in member char_field * @param _char_field New value for member char_field @@ -2121,6 +2124,7 @@ class KeyedCompleteTestType */ eProsima_user_DllExport char& char_field(); + /*! * @brief This function sets a value in member uint8_field * @param _uint8_field New value for member uint8_field @@ -2140,6 +2144,7 @@ class KeyedCompleteTestType */ eProsima_user_DllExport uint8_t& uint8_field(); + /*! * @brief This function sets a value in member int16_field * @param _int16_field New value for member int16_field @@ -2159,6 +2164,7 @@ class KeyedCompleteTestType */ eProsima_user_DllExport int16_t& int16_field(); + /*! * @brief This function sets a value in member uint16_field * @param _uint16_field New value for member uint16_field @@ -2178,6 +2184,7 @@ class KeyedCompleteTestType */ eProsima_user_DllExport uint16_t& uint16_field(); + /*! * @brief This function sets a value in member int32_field * @param _int32_field New value for member int32_field @@ -2197,6 +2204,7 @@ class KeyedCompleteTestType */ eProsima_user_DllExport int32_t& int32_field(); + /*! * @brief This function sets a value in member uint32_field * @param _uint32_field New value for member uint32_field @@ -2216,6 +2224,7 @@ class KeyedCompleteTestType */ eProsima_user_DllExport uint32_t& uint32_field(); + /*! * @brief This function sets a value in member int64_field * @param _int64_field New value for member int64_field @@ -2235,6 +2244,7 @@ class KeyedCompleteTestType */ eProsima_user_DllExport int64_t& int64_field(); + /*! * @brief This function sets a value in member uint64_field * @param _uint64_field New value for member uint64_field @@ -2254,6 +2264,7 @@ class KeyedCompleteTestType */ eProsima_user_DllExport uint64_t& uint64_field(); + /*! * @brief This function sets a value in member float_field * @param _float_field New value for member float_field @@ -2273,6 +2284,7 @@ class KeyedCompleteTestType */ eProsima_user_DllExport float& float_field(); + /*! * @brief This function sets a value in member double_field * @param _double_field New value for member double_field @@ -2292,6 +2304,7 @@ class KeyedCompleteTestType */ eProsima_user_DllExport double& double_field(); + /*! * @brief This function sets a value in member bool_field * @param _bool_field New value for member bool_field @@ -2311,6 +2324,7 @@ class KeyedCompleteTestType */ eProsima_user_DllExport bool& bool_field(); + /*! * @brief This function copies the value in member string_field * @param _string_field New value to be copied in member string_field @@ -2336,6 +2350,8 @@ class KeyedCompleteTestType * @return Reference to member string_field */ eProsima_user_DllExport std::string& string_field(); + + /*! * @brief This function sets a value in member enum_field * @param _enum_field New value for member enum_field @@ -2355,6 +2371,7 @@ class KeyedCompleteTestType */ eProsima_user_DllExport Color& enum_field(); + /*! * @brief This function sets a value in member enum2_field * @param _enum2_field New value for member enum2_field @@ -2374,6 +2391,7 @@ class KeyedCompleteTestType */ eProsima_user_DllExport Material& enum2_field(); + /*! * @brief This function copies the value in member struct_field * @param _struct_field New value to be copied in member struct_field @@ -2399,6 +2417,8 @@ class KeyedCompleteTestType * @return Reference to member struct_field */ eProsima_user_DllExport StructType& struct_field(); + + /*! * @brief This function copies the value in member array_char_field * @param _array_char_field New value to be copied in member array_char_field @@ -2424,6 +2444,8 @@ class KeyedCompleteTestType * @return Reference to member 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 @@ -2449,6 +2471,8 @@ class KeyedCompleteTestType * @return Reference to member 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 @@ -2474,6 +2498,8 @@ class KeyedCompleteTestType * @return Reference to member 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 @@ -2499,6 +2525,8 @@ class KeyedCompleteTestType * @return Reference to member 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 @@ -2524,6 +2552,8 @@ class KeyedCompleteTestType * @return Reference to member 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 @@ -2549,6 +2579,8 @@ class KeyedCompleteTestType * @return Reference to member 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 @@ -2574,6 +2606,8 @@ class KeyedCompleteTestType * @return Reference to member 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 @@ -2599,6 +2633,8 @@ class KeyedCompleteTestType * @return Reference to member 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 @@ -2624,6 +2660,8 @@ class KeyedCompleteTestType * @return Reference to member 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 @@ -2649,6 +2687,8 @@ class KeyedCompleteTestType * @return Reference to member array_double_field */ eProsima_user_DllExport std::array& array_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 @@ -2674,6 +2714,8 @@ class KeyedCompleteTestType * @return Reference to member array_bool_field */ eProsima_user_DllExport std::array& array_bool_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 @@ -2699,6 +2741,8 @@ class KeyedCompleteTestType * @return Reference to member 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 @@ -2724,6 +2768,8 @@ class KeyedCompleteTestType * @return Reference to member 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 @@ -2749,6 +2795,8 @@ class KeyedCompleteTestType * @return Reference to member 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 @@ -2774,6 +2822,8 @@ class KeyedCompleteTestType * @return Reference to member bounded_sequence_char_field */ eProsima_user_DllExport std::vector& bounded_sequence_char_field(); + + /*! * @brief This function copies the value in member bounded_sequence_uint8_field * @param _bounded_sequence_uint8_field New value to be copied in member bounded_sequence_uint8_field @@ -2799,6 +2849,8 @@ class KeyedCompleteTestType * @return Reference to member bounded_sequence_uint8_field */ eProsima_user_DllExport std::vector& bounded_sequence_uint8_field(); + + /*! * @brief This function copies the value in member bounded_sequence_int16_field * @param _bounded_sequence_int16_field New value to be copied in member bounded_sequence_int16_field @@ -2824,6 +2876,8 @@ class KeyedCompleteTestType * @return Reference to member bounded_sequence_int16_field */ eProsima_user_DllExport std::vector& bounded_sequence_int16_field(); + + /*! * @brief This function copies the value in member bounded_sequence_uint16_field * @param _bounded_sequence_uint16_field New value to be copied in member bounded_sequence_uint16_field @@ -2849,6 +2903,8 @@ class KeyedCompleteTestType * @return Reference to member bounded_sequence_uint16_field */ eProsima_user_DllExport std::vector& bounded_sequence_uint16_field(); + + /*! * @brief This function copies the value in member bounded_sequence_int32_field * @param _bounded_sequence_int32_field New value to be copied in member bounded_sequence_int32_field @@ -2874,6 +2930,8 @@ class KeyedCompleteTestType * @return Reference to member bounded_sequence_int32_field */ eProsima_user_DllExport std::vector& bounded_sequence_int32_field(); + + /*! * @brief This function copies the value in member bounded_sequence_uint32_field * @param _bounded_sequence_uint32_field New value to be copied in member bounded_sequence_uint32_field @@ -2899,6 +2957,8 @@ class KeyedCompleteTestType * @return Reference to member bounded_sequence_uint32_field */ eProsima_user_DllExport std::vector& bounded_sequence_uint32_field(); + + /*! * @brief This function copies the value in member bounded_sequence_int64_field * @param _bounded_sequence_int64_field New value to be copied in member bounded_sequence_int64_field @@ -2924,6 +2984,8 @@ class KeyedCompleteTestType * @return Reference to member bounded_sequence_int64_field */ eProsima_user_DllExport std::vector& bounded_sequence_int64_field(); + + /*! * @brief This function copies the value in member bounded_sequence_uint64_field * @param _bounded_sequence_uint64_field New value to be copied in member bounded_sequence_uint64_field @@ -2949,6 +3011,8 @@ class KeyedCompleteTestType * @return Reference to member bounded_sequence_uint64_field */ eProsima_user_DllExport std::vector& bounded_sequence_uint64_field(); + + /*! * @brief This function copies the value in member bounded_sequence_float_field * @param _bounded_sequence_float_field New value to be copied in member bounded_sequence_float_field @@ -2974,6 +3038,8 @@ class KeyedCompleteTestType * @return Reference to member bounded_sequence_float_field */ eProsima_user_DllExport std::vector& bounded_sequence_float_field(); + + /*! * @brief This function copies the value in member bounded_sequence_double_field * @param _bounded_sequence_double_field New value to be copied in member bounded_sequence_double_field @@ -2999,6 +3065,8 @@ class KeyedCompleteTestType * @return Reference to member bounded_sequence_double_field */ eProsima_user_DllExport std::vector& bounded_sequence_double_field(); + + /*! * @brief This function copies the value in member bounded_sequence_bool_field * @param _bounded_sequence_bool_field New value to be copied in member bounded_sequence_bool_field @@ -3024,6 +3092,8 @@ class KeyedCompleteTestType * @return Reference to member bounded_sequence_bool_field */ eProsima_user_DllExport std::vector& bounded_sequence_bool_field(); + + /*! * @brief This function copies the value in member bounded_sequence_enum_field * @param _bounded_sequence_enum_field New value to be copied in member bounded_sequence_enum_field @@ -3049,6 +3119,8 @@ class KeyedCompleteTestType * @return Reference to member bounded_sequence_enum_field */ eProsima_user_DllExport std::vector& bounded_sequence_enum_field(); + + /*! * @brief This function copies the value in member bounded_sequence_enum2_field * @param _bounded_sequence_enum2_field New value to be copied in member bounded_sequence_enum2_field @@ -3074,6 +3146,8 @@ class KeyedCompleteTestType * @return Reference to member bounded_sequence_enum2_field */ eProsima_user_DllExport std::vector& bounded_sequence_enum2_field(); + + /*! * @brief This function copies the value in member bounded_sequence_struct_field * @param _bounded_sequence_struct_field New value to be copied in member bounded_sequence_struct_field @@ -3099,6 +3173,8 @@ class KeyedCompleteTestType * @return Reference to member bounded_sequence_struct_field */ eProsima_user_DllExport std::vector& bounded_sequence_struct_field(); + + /*! * @brief This function copies the value in member unbounded_sequence_char_field * @param _unbounded_sequence_char_field New value to be copied in member unbounded_sequence_char_field @@ -3124,6 +3200,8 @@ class KeyedCompleteTestType * @return Reference to member unbounded_sequence_char_field */ eProsima_user_DllExport std::vector& unbounded_sequence_char_field(); + + /*! * @brief This function copies the value in member unbounded_sequence_uint8_field * @param _unbounded_sequence_uint8_field New value to be copied in member unbounded_sequence_uint8_field @@ -3149,6 +3227,8 @@ class KeyedCompleteTestType * @return Reference to member unbounded_sequence_uint8_field */ eProsima_user_DllExport std::vector& unbounded_sequence_uint8_field(); + + /*! * @brief This function copies the value in member unbounded_sequence_int16_field * @param _unbounded_sequence_int16_field New value to be copied in member unbounded_sequence_int16_field @@ -3174,6 +3254,8 @@ class KeyedCompleteTestType * @return Reference to member unbounded_sequence_int16_field */ eProsima_user_DllExport std::vector& unbounded_sequence_int16_field(); + + /*! * @brief This function copies the value in member unbounded_sequence_uint16_field * @param _unbounded_sequence_uint16_field New value to be copied in member unbounded_sequence_uint16_field @@ -3199,6 +3281,8 @@ class KeyedCompleteTestType * @return Reference to member unbounded_sequence_uint16_field */ eProsima_user_DllExport std::vector& unbounded_sequence_uint16_field(); + + /*! * @brief This function copies the value in member unbounded_sequence_int32_field * @param _unbounded_sequence_int32_field New value to be copied in member unbounded_sequence_int32_field @@ -3224,6 +3308,8 @@ class KeyedCompleteTestType * @return Reference to member unbounded_sequence_int32_field */ eProsima_user_DllExport std::vector& unbounded_sequence_int32_field(); + + /*! * @brief This function copies the value in member unbounded_sequence_uint32_field * @param _unbounded_sequence_uint32_field New value to be copied in member unbounded_sequence_uint32_field @@ -3249,6 +3335,8 @@ class KeyedCompleteTestType * @return Reference to member unbounded_sequence_uint32_field */ eProsima_user_DllExport std::vector& unbounded_sequence_uint32_field(); + + /*! * @brief This function copies the value in member unbounded_sequence_int64_field * @param _unbounded_sequence_int64_field New value to be copied in member unbounded_sequence_int64_field @@ -3274,6 +3362,8 @@ class KeyedCompleteTestType * @return Reference to member unbounded_sequence_int64_field */ eProsima_user_DllExport std::vector& unbounded_sequence_int64_field(); + + /*! * @brief This function copies the value in member unbounded_sequence_uint64_field * @param _unbounded_sequence_uint64_field New value to be copied in member unbounded_sequence_uint64_field @@ -3299,6 +3389,8 @@ class KeyedCompleteTestType * @return Reference to member unbounded_sequence_uint64_field */ eProsima_user_DllExport std::vector& unbounded_sequence_uint64_field(); + + /*! * @brief This function copies the value in member unbounded_sequence_float_field * @param _unbounded_sequence_float_field New value to be copied in member unbounded_sequence_float_field @@ -3324,6 +3416,8 @@ class KeyedCompleteTestType * @return Reference to member unbounded_sequence_float_field */ eProsima_user_DllExport std::vector& unbounded_sequence_float_field(); + + /*! * @brief This function copies the value in member unbounded_sequence_double_field * @param _unbounded_sequence_double_field New value to be copied in member unbounded_sequence_double_field @@ -3349,6 +3443,8 @@ class KeyedCompleteTestType * @return Reference to member unbounded_sequence_double_field */ eProsima_user_DllExport std::vector& unbounded_sequence_double_field(); + + /*! * @brief This function copies the value in member unbounded_sequence_bool_field * @param _unbounded_sequence_bool_field New value to be copied in member unbounded_sequence_bool_field @@ -3374,6 +3470,8 @@ class KeyedCompleteTestType * @return Reference to member unbounded_sequence_bool_field */ eProsima_user_DllExport std::vector& unbounded_sequence_bool_field(); + + /*! * @brief This function copies the value in member unbounded_sequence_enum_field * @param _unbounded_sequence_enum_field New value to be copied in member unbounded_sequence_enum_field @@ -3399,6 +3497,8 @@ class KeyedCompleteTestType * @return Reference to member unbounded_sequence_enum_field */ eProsima_user_DllExport std::vector& unbounded_sequence_enum_field(); + + /*! * @brief This function copies the value in member unbounded_sequence_enum2_field * @param _unbounded_sequence_enum2_field New value to be copied in member unbounded_sequence_enum2_field @@ -3424,6 +3524,8 @@ class KeyedCompleteTestType * @return Reference to member unbounded_sequence_enum2_field */ eProsima_user_DllExport std::vector& unbounded_sequence_enum2_field(); + + /*! * @brief This function copies the value in member unbounded_sequence_struct_field * @param _unbounded_sequence_struct_field New value to be copied in member unbounded_sequence_struct_field @@ -3450,94 +3552,37 @@ class KeyedCompleteTestType */ 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. - */ - 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. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const KeyedCompleteTestType& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - private: - int32_t m_id; - char m_char_field; - uint8_t m_uint8_field; - int16_t m_int16_field; - uint16_t m_uint16_field; - int32_t m_int32_field; - uint32_t m_uint32_field; - int64_t m_int64_field; - uint64_t m_uint64_field; - float m_float_field; - double m_double_field; - bool m_bool_field; + int32_t m_id{0}; + char m_char_field{0}; + uint8_t m_uint8_field{0}; + int16_t m_int16_field{0}; + uint16_t m_uint16_field{0}; + int32_t m_int32_field{0}; + uint32_t m_uint32_field{0}; + int64_t m_int64_field{0}; + uint64_t m_uint64_field{0}; + float m_float_field{0.0}; + double m_double_field{0.0}; + bool m_bool_field{false}; std::string m_string_field; - Color m_enum_field; - Material m_enum2_field; + Color m_enum_field{::RED}; + Material m_enum2_field{::WOOD}; 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_bool_field; - std::array m_array_enum_field; - std::array m_array_enum2_field; + std::array m_array_char_field{0}; + std::array m_array_uint8_field{0}; + std::array m_array_int16_field{0}; + std::array m_array_uint16_field{0}; + std::array m_array_int32_field{0}; + std::array m_array_uint32_field{0}; + std::array m_array_int64_field{0}; + std::array m_array_uint64_field{0}; + std::array m_array_float_field{0.0}; + std::array m_array_double_field{0.0}; + std::array m_array_bool_field{false}; + std::array m_array_enum_field{::RED}; + std::array m_array_enum2_field{::WOOD}; std::array m_array_struct_field; std::vector m_bounded_sequence_char_field; std::vector m_bounded_sequence_uint8_field; diff --git a/fastdds_python/test/types/test_complete.i b/fastdds_python/test/types/test_complete.i index 8a12f743..dcc095a4 100644 --- a/fastdds_python/test/types/test_complete.i +++ b/fastdds_python/test/types/test_complete.i @@ -16,17 +16,17 @@ * @file test_complete.i * This header file contains the SWIG interface of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen. */ %module test_complete // SWIG helper modules %include "stdint.i" -%include "std_string.i" -%include "std_vector.i" %include "std_array.i" %include "std_map.i" +%include "std_string.i" +%include "std_vector.i" %include "typemaps.i" // Assignemt operators are ignored, as there is no such thing in Python. @@ -49,8 +49,6 @@ %import(module="fastdds") "fastdds/dds/core/LoanableTypedCollection.hpp" %import(module="fastdds") "fastdds/dds/core/LoanableSequence.hpp" - - //////////////////////////////////////////////////////// // Binding for class StructType //////////////////////////////////////////////////////// @@ -69,6 +67,7 @@ %ignore StructType::char_field(); %rename("%s") StructType::char_field() const; + %ignore StructType::uint8_field(uint8_t&&); // Overloaded getter methods shadow each other and are equivalent in python @@ -77,6 +76,7 @@ %ignore StructType::uint8_field(); %rename("%s") StructType::uint8_field() const; + %ignore StructType::int16_field(int16_t&&); // Overloaded getter methods shadow each other and are equivalent in python @@ -85,6 +85,7 @@ %ignore StructType::int16_field(); %rename("%s") StructType::int16_field() const; + %ignore StructType::uint16_field(uint16_t&&); // Overloaded getter methods shadow each other and are equivalent in python @@ -93,6 +94,7 @@ %ignore StructType::uint16_field(); %rename("%s") StructType::uint16_field() const; + %ignore StructType::int32_field(int32_t&&); // Overloaded getter methods shadow each other and are equivalent in python @@ -101,6 +103,7 @@ %ignore StructType::int32_field(); %rename("%s") StructType::int32_field() const; + %ignore StructType::uint32_field(uint32_t&&); // Overloaded getter methods shadow each other and are equivalent in python @@ -109,6 +112,7 @@ %ignore StructType::uint32_field(); %rename("%s") StructType::uint32_field() const; + %ignore StructType::int64_field(int64_t&&); // Overloaded getter methods shadow each other and are equivalent in python @@ -117,6 +121,7 @@ %ignore StructType::int64_field(); %rename("%s") StructType::int64_field() const; + %ignore StructType::uint64_field(uint64_t&&); // Overloaded getter methods shadow each other and are equivalent in python @@ -125,6 +130,7 @@ %ignore StructType::uint64_field(); %rename("%s") StructType::uint64_field() const; + %ignore StructType::float_field(float&&); // Overloaded getter methods shadow each other and are equivalent in python @@ -133,6 +139,7 @@ %ignore StructType::float_field(); %rename("%s") StructType::float_field() const; + %ignore StructType::double_field(double&&); // Overloaded getter methods shadow each other and are equivalent in python @@ -141,6 +148,7 @@ %ignore StructType::double_field(); %rename("%s") StructType::double_field() const; + %ignore StructType::bool_field(bool&&); // Overloaded getter methods shadow each other and are equivalent in python @@ -149,6 +157,7 @@ %ignore StructType::bool_field(); %rename("%s") StructType::bool_field() const; + %ignore StructType::string_field(std::string&&); // Overloaded getter methods shadow each other and are equivalent in python @@ -157,6 +166,7 @@ %ignore StructType::string_field(); %rename("%s") StructType::string_field() const; + %ignore StructType::enum_field(Color&&); // Overloaded getter methods shadow each other and are equivalent in python @@ -165,6 +175,7 @@ %ignore StructType::enum_field(); %rename("%s") StructType::enum_field() const; + %ignore StructType::enum2_field(Material&&); // Overloaded getter methods shadow each other and are equivalent in python @@ -174,6 +185,7 @@ %rename("%s") StructType::enum2_field() const; + %template(_StructTypeSeq) eprosima::fastdds::dds::LoanableTypedCollection; %template(StructTypeSeq) eprosima::fastdds::dds::LoanableSequence; %extend eprosima::fastdds::dds::LoanableSequence @@ -209,6 +221,7 @@ %ignore CompleteTestType::char_field(); %rename("%s") CompleteTestType::char_field() const; + %ignore CompleteTestType::uint8_field(uint8_t&&); // Overloaded getter methods shadow each other and are equivalent in python @@ -217,6 +230,7 @@ %ignore CompleteTestType::uint8_field(); %rename("%s") CompleteTestType::uint8_field() const; + %ignore CompleteTestType::int16_field(int16_t&&); // Overloaded getter methods shadow each other and are equivalent in python @@ -225,6 +239,7 @@ %ignore CompleteTestType::int16_field(); %rename("%s") CompleteTestType::int16_field() const; + %ignore CompleteTestType::uint16_field(uint16_t&&); // Overloaded getter methods shadow each other and are equivalent in python @@ -233,6 +248,7 @@ %ignore CompleteTestType::uint16_field(); %rename("%s") CompleteTestType::uint16_field() const; + %ignore CompleteTestType::int32_field(int32_t&&); // Overloaded getter methods shadow each other and are equivalent in python @@ -241,6 +257,7 @@ %ignore CompleteTestType::int32_field(); %rename("%s") CompleteTestType::int32_field() const; + %ignore CompleteTestType::uint32_field(uint32_t&&); // Overloaded getter methods shadow each other and are equivalent in python @@ -249,6 +266,7 @@ %ignore CompleteTestType::uint32_field(); %rename("%s") CompleteTestType::uint32_field() const; + %ignore CompleteTestType::int64_field(int64_t&&); // Overloaded getter methods shadow each other and are equivalent in python @@ -257,6 +275,7 @@ %ignore CompleteTestType::int64_field(); %rename("%s") CompleteTestType::int64_field() const; + %ignore CompleteTestType::uint64_field(uint64_t&&); // Overloaded getter methods shadow each other and are equivalent in python @@ -265,6 +284,7 @@ %ignore CompleteTestType::uint64_field(); %rename("%s") CompleteTestType::uint64_field() const; + %ignore CompleteTestType::float_field(float&&); // Overloaded getter methods shadow each other and are equivalent in python @@ -273,6 +293,7 @@ %ignore CompleteTestType::float_field(); %rename("%s") CompleteTestType::float_field() const; + %ignore CompleteTestType::double_field(double&&); // Overloaded getter methods shadow each other and are equivalent in python @@ -281,6 +302,7 @@ %ignore CompleteTestType::double_field(); %rename("%s") CompleteTestType::double_field() const; + %ignore CompleteTestType::bool_field(bool&&); // Overloaded getter methods shadow each other and are equivalent in python @@ -289,6 +311,7 @@ %ignore CompleteTestType::bool_field(); %rename("%s") CompleteTestType::bool_field() const; + %ignore CompleteTestType::string_field(std::string&&); // Overloaded getter methods shadow each other and are equivalent in python @@ -297,6 +320,7 @@ %ignore CompleteTestType::string_field(); %rename("%s") CompleteTestType::string_field() const; + %ignore CompleteTestType::enum_field(Color&&); // Overloaded getter methods shadow each other and are equivalent in python @@ -305,6 +329,7 @@ %ignore CompleteTestType::enum_field(); %rename("%s") CompleteTestType::enum_field() const; + %ignore CompleteTestType::enum2_field(Material&&); // Overloaded getter methods shadow each other and are equivalent in python @@ -313,6 +338,7 @@ %ignore CompleteTestType::enum2_field(); %rename("%s") CompleteTestType::enum2_field() const; + %ignore CompleteTestType::struct_field(StructType&&); // Overloaded getter methods shadow each other and are equivalent in python @@ -321,6 +347,7 @@ %ignore CompleteTestType::struct_field(); %rename("%s") CompleteTestType::struct_field() const; + %ignore CompleteTestType::array_char_field(std::array&&); // Overloaded getter methods shadow each other and are equivalent in python @@ -335,6 +362,7 @@ return self->data(); } } + %ignore CompleteTestType::array_uint8_field(std::array&&); // Overloaded getter methods shadow each other and are equivalent in python @@ -349,6 +377,7 @@ return self->data(); } } + %ignore CompleteTestType::array_int16_field(std::array&&); // Overloaded getter methods shadow each other and are equivalent in python @@ -363,6 +392,7 @@ return self->data(); } } + %ignore CompleteTestType::array_uint16_field(std::array&&); // Overloaded getter methods shadow each other and are equivalent in python @@ -377,6 +407,7 @@ return self->data(); } } + %ignore CompleteTestType::array_int32_field(std::array&&); // Overloaded getter methods shadow each other and are equivalent in python @@ -391,6 +422,7 @@ return self->data(); } } + %ignore CompleteTestType::array_uint32_field(std::array&&); // Overloaded getter methods shadow each other and are equivalent in python @@ -405,6 +437,7 @@ return self->data(); } } + %ignore CompleteTestType::array_int64_field(std::array&&); // Overloaded getter methods shadow each other and are equivalent in python @@ -419,6 +452,7 @@ return self->data(); } } + %ignore CompleteTestType::array_uint64_field(std::array&&); // Overloaded getter methods shadow each other and are equivalent in python @@ -433,6 +467,7 @@ return self->data(); } } + %ignore CompleteTestType::array_float_field(std::array&&); // Overloaded getter methods shadow each other and are equivalent in python @@ -447,6 +482,7 @@ return self->data(); } } + %ignore CompleteTestType::array_double_field(std::array&&); // Overloaded getter methods shadow each other and are equivalent in python @@ -461,6 +497,7 @@ return self->data(); } } + %ignore CompleteTestType::array_bool_field(std::array&&); // Overloaded getter methods shadow each other and are equivalent in python @@ -475,6 +512,7 @@ return self->data(); } } + %ignore CompleteTestType::array_enum_field(std::array&&); // Overloaded getter methods shadow each other and are equivalent in python @@ -489,6 +527,7 @@ return self->data(); } } + %ignore CompleteTestType::array_enum2_field(std::array&&); // Overloaded getter methods shadow each other and are equivalent in python @@ -503,6 +542,7 @@ return self->data(); } } + %ignore CompleteTestType::array_struct_field(std::array&&); // Overloaded getter methods shadow each other and are equivalent in python @@ -523,7 +563,11 @@ { return self->data(); } -}%template(char_vector) std::vector; +} + +%template( +char_vector +) std::vector; %ignore CompleteTestType::bounded_sequence_uint8_field(std::vector&&); @@ -537,7 +581,11 @@ { return self->data(); } -}%template(uint8_t_vector) std::vector; +} + +%template( +uint8_t_vector +) std::vector; %ignore CompleteTestType::bounded_sequence_int16_field(std::vector&&); @@ -551,7 +599,11 @@ { return self->data(); } -}%template(int16_t_vector) std::vector; +} + +%template( +int16_t_vector +) std::vector; %ignore CompleteTestType::bounded_sequence_uint16_field(std::vector&&); @@ -565,7 +617,11 @@ { return self->data(); } -}%template(uint16_t_vector) std::vector; +} + +%template( +uint16_t_vector +) std::vector; %ignore CompleteTestType::bounded_sequence_int32_field(std::vector&&); @@ -579,7 +635,11 @@ { return self->data(); } -}%template(int32_t_vector) std::vector; +} + +%template( +int32_t_vector +) std::vector; %ignore CompleteTestType::bounded_sequence_uint32_field(std::vector&&); @@ -593,7 +653,11 @@ { return self->data(); } -}%template(uint32_t_vector) std::vector; +} + +%template( +uint32_t_vector +) std::vector; %ignore CompleteTestType::bounded_sequence_int64_field(std::vector&&); @@ -607,7 +671,11 @@ { return self->data(); } -}%template(int64_t_vector) std::vector; +} + +%template( +int64_t_vector +) std::vector; %ignore CompleteTestType::bounded_sequence_uint64_field(std::vector&&); @@ -621,7 +689,11 @@ { return self->data(); } -}%template(uint64_t_vector) std::vector; +} + +%template( +uint64_t_vector +) std::vector; %ignore CompleteTestType::bounded_sequence_float_field(std::vector&&); @@ -635,7 +707,11 @@ { return self->data(); } -}%template(float_vector) std::vector; +} + +%template( +float_vector +) std::vector; %ignore CompleteTestType::bounded_sequence_double_field(std::vector&&); @@ -649,7 +725,11 @@ { return self->data(); } -}%template(double_vector) std::vector; +} + +%template( +double_vector +) std::vector; %ignore CompleteTestType::bounded_sequence_bool_field(std::vector&&); @@ -657,7 +737,9 @@ // Const accesors produced constant enums instead of arrays/dictionaries when used // We ignore them to prevent this %ignore CompleteTestType::bounded_sequence_bool_field() const; -%template(bool_vector) std::vector; +%template( +bool_vector +) std::vector; %ignore CompleteTestType::bounded_sequence_enum_field(std::vector&&); @@ -671,7 +753,11 @@ { return self->data(); } -}%template(Color_vector) std::vector; +} + +%template( +Color_vector +) std::vector; %ignore CompleteTestType::bounded_sequence_enum2_field(std::vector&&); @@ -685,7 +771,11 @@ { return self->data(); } -}%template(Material_vector) std::vector; +} + +%template( +Material_vector +) std::vector; %ignore CompleteTestType::bounded_sequence_struct_field(std::vector&&); @@ -693,7 +783,9 @@ // Const accesors produced constant enums instead of arrays/dictionaries when used // We ignore them to prevent this %ignore CompleteTestType::bounded_sequence_struct_field() const; -%template(StructType_vector) std::vector; +%template( +StructType_vector +) std::vector; %ignore CompleteTestType::unbounded_sequence_char_field(std::vector&&); @@ -707,7 +799,11 @@ { return self->data(); } -}%template(char_vector) std::vector; +} + +%template( +char_vector +) std::vector; %ignore CompleteTestType::unbounded_sequence_uint8_field(std::vector&&); @@ -721,7 +817,11 @@ { return self->data(); } -}%template(uint8_t_vector) std::vector; +} + +%template( +uint8_t_vector +) std::vector; %ignore CompleteTestType::unbounded_sequence_int16_field(std::vector&&); @@ -735,7 +835,11 @@ { return self->data(); } -}%template(int16_t_vector) std::vector; +} + +%template( +int16_t_vector +) std::vector; %ignore CompleteTestType::unbounded_sequence_uint16_field(std::vector&&); @@ -749,7 +853,11 @@ { return self->data(); } -}%template(uint16_t_vector) std::vector; +} + +%template( +uint16_t_vector +) std::vector; %ignore CompleteTestType::unbounded_sequence_int32_field(std::vector&&); @@ -763,7 +871,11 @@ { return self->data(); } -}%template(int32_t_vector) std::vector; +} + +%template( +int32_t_vector +) std::vector; %ignore CompleteTestType::unbounded_sequence_uint32_field(std::vector&&); @@ -777,7 +889,11 @@ { return self->data(); } -}%template(uint32_t_vector) std::vector; +} + +%template( +uint32_t_vector +) std::vector; %ignore CompleteTestType::unbounded_sequence_int64_field(std::vector&&); @@ -791,7 +907,11 @@ { return self->data(); } -}%template(int64_t_vector) std::vector; +} + +%template( +int64_t_vector +) std::vector; %ignore CompleteTestType::unbounded_sequence_uint64_field(std::vector&&); @@ -805,7 +925,11 @@ { return self->data(); } -}%template(uint64_t_vector) std::vector; +} + +%template( +uint64_t_vector +) std::vector; %ignore CompleteTestType::unbounded_sequence_float_field(std::vector&&); @@ -819,7 +943,11 @@ { return self->data(); } -}%template(float_vector) std::vector; +} + +%template( +float_vector +) std::vector; %ignore CompleteTestType::unbounded_sequence_double_field(std::vector&&); @@ -833,7 +961,11 @@ { return self->data(); } -}%template(double_vector) std::vector; +} + +%template( +double_vector +) std::vector; %ignore CompleteTestType::unbounded_sequence_bool_field(std::vector&&); @@ -841,7 +973,9 @@ // Const accesors produced constant enums instead of arrays/dictionaries when used // We ignore them to prevent this %ignore CompleteTestType::unbounded_sequence_bool_field() const; -%template(bool_vector) std::vector; +%template( +bool_vector +) std::vector; %ignore CompleteTestType::unbounded_sequence_enum_field(std::vector&&); @@ -855,7 +989,11 @@ { return self->data(); } -}%template(Color_vector) std::vector; +} + +%template( +Color_vector +) std::vector; %ignore CompleteTestType::unbounded_sequence_enum2_field(std::vector&&); @@ -869,7 +1007,11 @@ { return self->data(); } -}%template(Material_vector) std::vector; +} + +%template( +Material_vector +) std::vector; %ignore CompleteTestType::unbounded_sequence_struct_field(std::vector&&); @@ -877,7 +1019,9 @@ // Const accesors produced constant enums instead of arrays/dictionaries when used // We ignore them to prevent this %ignore CompleteTestType::unbounded_sequence_struct_field() const; -%template(StructType_vector) std::vector; +%template( +StructType_vector +) std::vector; %template(_CompleteTestTypeSeq) eprosima::fastdds::dds::LoanableTypedCollection; @@ -913,6 +1057,7 @@ %ignore KeyedCompleteTestType::id(); %rename("%s") KeyedCompleteTestType::id() const; + %ignore KeyedCompleteTestType::char_field(char&&); // Overloaded getter methods shadow each other and are equivalent in python @@ -921,6 +1066,7 @@ %ignore KeyedCompleteTestType::char_field(); %rename("%s") KeyedCompleteTestType::char_field() const; + %ignore KeyedCompleteTestType::uint8_field(uint8_t&&); // Overloaded getter methods shadow each other and are equivalent in python @@ -929,6 +1075,7 @@ %ignore KeyedCompleteTestType::uint8_field(); %rename("%s") KeyedCompleteTestType::uint8_field() const; + %ignore KeyedCompleteTestType::int16_field(int16_t&&); // Overloaded getter methods shadow each other and are equivalent in python @@ -937,6 +1084,7 @@ %ignore KeyedCompleteTestType::int16_field(); %rename("%s") KeyedCompleteTestType::int16_field() const; + %ignore KeyedCompleteTestType::uint16_field(uint16_t&&); // Overloaded getter methods shadow each other and are equivalent in python @@ -945,6 +1093,7 @@ %ignore KeyedCompleteTestType::uint16_field(); %rename("%s") KeyedCompleteTestType::uint16_field() const; + %ignore KeyedCompleteTestType::int32_field(int32_t&&); // Overloaded getter methods shadow each other and are equivalent in python @@ -953,6 +1102,7 @@ %ignore KeyedCompleteTestType::int32_field(); %rename("%s") KeyedCompleteTestType::int32_field() const; + %ignore KeyedCompleteTestType::uint32_field(uint32_t&&); // Overloaded getter methods shadow each other and are equivalent in python @@ -961,6 +1111,7 @@ %ignore KeyedCompleteTestType::uint32_field(); %rename("%s") KeyedCompleteTestType::uint32_field() const; + %ignore KeyedCompleteTestType::int64_field(int64_t&&); // Overloaded getter methods shadow each other and are equivalent in python @@ -969,6 +1120,7 @@ %ignore KeyedCompleteTestType::int64_field(); %rename("%s") KeyedCompleteTestType::int64_field() const; + %ignore KeyedCompleteTestType::uint64_field(uint64_t&&); // Overloaded getter methods shadow each other and are equivalent in python @@ -977,6 +1129,7 @@ %ignore KeyedCompleteTestType::uint64_field(); %rename("%s") KeyedCompleteTestType::uint64_field() const; + %ignore KeyedCompleteTestType::float_field(float&&); // Overloaded getter methods shadow each other and are equivalent in python @@ -985,6 +1138,7 @@ %ignore KeyedCompleteTestType::float_field(); %rename("%s") KeyedCompleteTestType::float_field() const; + %ignore KeyedCompleteTestType::double_field(double&&); // Overloaded getter methods shadow each other and are equivalent in python @@ -993,6 +1147,7 @@ %ignore KeyedCompleteTestType::double_field(); %rename("%s") KeyedCompleteTestType::double_field() const; + %ignore KeyedCompleteTestType::bool_field(bool&&); // Overloaded getter methods shadow each other and are equivalent in python @@ -1001,6 +1156,7 @@ %ignore KeyedCompleteTestType::bool_field(); %rename("%s") KeyedCompleteTestType::bool_field() const; + %ignore KeyedCompleteTestType::string_field(std::string&&); // Overloaded getter methods shadow each other and are equivalent in python @@ -1009,6 +1165,7 @@ %ignore KeyedCompleteTestType::string_field(); %rename("%s") KeyedCompleteTestType::string_field() const; + %ignore KeyedCompleteTestType::enum_field(Color&&); // Overloaded getter methods shadow each other and are equivalent in python @@ -1017,6 +1174,7 @@ %ignore KeyedCompleteTestType::enum_field(); %rename("%s") KeyedCompleteTestType::enum_field() const; + %ignore KeyedCompleteTestType::enum2_field(Material&&); // Overloaded getter methods shadow each other and are equivalent in python @@ -1025,6 +1183,7 @@ %ignore KeyedCompleteTestType::enum2_field(); %rename("%s") KeyedCompleteTestType::enum2_field() const; + %ignore KeyedCompleteTestType::struct_field(StructType&&); // Overloaded getter methods shadow each other and are equivalent in python @@ -1033,6 +1192,7 @@ %ignore KeyedCompleteTestType::struct_field(); %rename("%s") KeyedCompleteTestType::struct_field() const; + %ignore KeyedCompleteTestType::array_char_field(std::array&&); // Overloaded getter methods shadow each other and are equivalent in python @@ -1047,6 +1207,7 @@ return self->data(); } } + %ignore KeyedCompleteTestType::array_uint8_field(std::array&&); // Overloaded getter methods shadow each other and are equivalent in python @@ -1061,6 +1222,7 @@ return self->data(); } } + %ignore KeyedCompleteTestType::array_int16_field(std::array&&); // Overloaded getter methods shadow each other and are equivalent in python @@ -1075,6 +1237,7 @@ return self->data(); } } + %ignore KeyedCompleteTestType::array_uint16_field(std::array&&); // Overloaded getter methods shadow each other and are equivalent in python @@ -1089,6 +1252,7 @@ return self->data(); } } + %ignore KeyedCompleteTestType::array_int32_field(std::array&&); // Overloaded getter methods shadow each other and are equivalent in python @@ -1103,6 +1267,7 @@ return self->data(); } } + %ignore KeyedCompleteTestType::array_uint32_field(std::array&&); // Overloaded getter methods shadow each other and are equivalent in python @@ -1117,6 +1282,7 @@ return self->data(); } } + %ignore KeyedCompleteTestType::array_int64_field(std::array&&); // Overloaded getter methods shadow each other and are equivalent in python @@ -1131,6 +1297,7 @@ return self->data(); } } + %ignore KeyedCompleteTestType::array_uint64_field(std::array&&); // Overloaded getter methods shadow each other and are equivalent in python @@ -1145,6 +1312,7 @@ return self->data(); } } + %ignore KeyedCompleteTestType::array_float_field(std::array&&); // Overloaded getter methods shadow each other and are equivalent in python @@ -1159,6 +1327,7 @@ return self->data(); } } + %ignore KeyedCompleteTestType::array_double_field(std::array&&); // Overloaded getter methods shadow each other and are equivalent in python @@ -1173,6 +1342,7 @@ return self->data(); } } + %ignore KeyedCompleteTestType::array_bool_field(std::array&&); // Overloaded getter methods shadow each other and are equivalent in python @@ -1187,6 +1357,7 @@ return self->data(); } } + %ignore KeyedCompleteTestType::array_enum_field(std::array&&); // Overloaded getter methods shadow each other and are equivalent in python @@ -1201,6 +1372,7 @@ return self->data(); } } + %ignore KeyedCompleteTestType::array_enum2_field(std::array&&); // Overloaded getter methods shadow each other and are equivalent in python @@ -1215,6 +1387,7 @@ return self->data(); } } + %ignore KeyedCompleteTestType::array_struct_field(std::array&&); // Overloaded getter methods shadow each other and are equivalent in python @@ -1235,7 +1408,11 @@ { return self->data(); } -}%template(char_vector) std::vector; +} + +%template( +char_vector +) std::vector; %ignore KeyedCompleteTestType::bounded_sequence_uint8_field(std::vector&&); @@ -1249,7 +1426,11 @@ { return self->data(); } -}%template(uint8_t_vector) std::vector; +} + +%template( +uint8_t_vector +) std::vector; %ignore KeyedCompleteTestType::bounded_sequence_int16_field(std::vector&&); @@ -1263,7 +1444,11 @@ { return self->data(); } -}%template(int16_t_vector) std::vector; +} + +%template( +int16_t_vector +) std::vector; %ignore KeyedCompleteTestType::bounded_sequence_uint16_field(std::vector&&); @@ -1277,7 +1462,11 @@ { return self->data(); } -}%template(uint16_t_vector) std::vector; +} + +%template( +uint16_t_vector +) std::vector; %ignore KeyedCompleteTestType::bounded_sequence_int32_field(std::vector&&); @@ -1291,7 +1480,11 @@ { return self->data(); } -}%template(int32_t_vector) std::vector; +} + +%template( +int32_t_vector +) std::vector; %ignore KeyedCompleteTestType::bounded_sequence_uint32_field(std::vector&&); @@ -1305,7 +1498,11 @@ { return self->data(); } -}%template(uint32_t_vector) std::vector; +} + +%template( +uint32_t_vector +) std::vector; %ignore KeyedCompleteTestType::bounded_sequence_int64_field(std::vector&&); @@ -1319,7 +1516,11 @@ { return self->data(); } -}%template(int64_t_vector) std::vector; +} + +%template( +int64_t_vector +) std::vector; %ignore KeyedCompleteTestType::bounded_sequence_uint64_field(std::vector&&); @@ -1333,7 +1534,11 @@ { return self->data(); } -}%template(uint64_t_vector) std::vector; +} + +%template( +uint64_t_vector +) std::vector; %ignore KeyedCompleteTestType::bounded_sequence_float_field(std::vector&&); @@ -1347,7 +1552,11 @@ { return self->data(); } -}%template(float_vector) std::vector; +} + +%template( +float_vector +) std::vector; %ignore KeyedCompleteTestType::bounded_sequence_double_field(std::vector&&); @@ -1361,7 +1570,11 @@ { return self->data(); } -}%template(double_vector) std::vector; +} + +%template( +double_vector +) std::vector; %ignore KeyedCompleteTestType::bounded_sequence_bool_field(std::vector&&); @@ -1369,7 +1582,9 @@ // Const accesors produced constant enums instead of arrays/dictionaries when used // We ignore them to prevent this %ignore KeyedCompleteTestType::bounded_sequence_bool_field() const; -%template(bool_vector) std::vector; +%template( +bool_vector +) std::vector; %ignore KeyedCompleteTestType::bounded_sequence_enum_field(std::vector&&); @@ -1383,7 +1598,11 @@ { return self->data(); } -}%template(Color_vector) std::vector; +} + +%template( +Color_vector +) std::vector; %ignore KeyedCompleteTestType::bounded_sequence_enum2_field(std::vector&&); @@ -1397,7 +1616,11 @@ { return self->data(); } -}%template(Material_vector) std::vector; +} + +%template( +Material_vector +) std::vector; %ignore KeyedCompleteTestType::bounded_sequence_struct_field(std::vector&&); @@ -1405,7 +1628,9 @@ // Const accesors produced constant enums instead of arrays/dictionaries when used // We ignore them to prevent this %ignore KeyedCompleteTestType::bounded_sequence_struct_field() const; -%template(StructType_vector) std::vector; +%template( +StructType_vector +) std::vector; %ignore KeyedCompleteTestType::unbounded_sequence_char_field(std::vector&&); @@ -1419,7 +1644,11 @@ { return self->data(); } -}%template(char_vector) std::vector; +} + +%template( +char_vector +) std::vector; %ignore KeyedCompleteTestType::unbounded_sequence_uint8_field(std::vector&&); @@ -1433,7 +1662,11 @@ { return self->data(); } -}%template(uint8_t_vector) std::vector; +} + +%template( +uint8_t_vector +) std::vector; %ignore KeyedCompleteTestType::unbounded_sequence_int16_field(std::vector&&); @@ -1447,7 +1680,11 @@ { return self->data(); } -}%template(int16_t_vector) std::vector; +} + +%template( +int16_t_vector +) std::vector; %ignore KeyedCompleteTestType::unbounded_sequence_uint16_field(std::vector&&); @@ -1461,7 +1698,11 @@ { return self->data(); } -}%template(uint16_t_vector) std::vector; +} + +%template( +uint16_t_vector +) std::vector; %ignore KeyedCompleteTestType::unbounded_sequence_int32_field(std::vector&&); @@ -1475,7 +1716,11 @@ { return self->data(); } -}%template(int32_t_vector) std::vector; +} + +%template( +int32_t_vector +) std::vector; %ignore KeyedCompleteTestType::unbounded_sequence_uint32_field(std::vector&&); @@ -1489,7 +1734,11 @@ { return self->data(); } -}%template(uint32_t_vector) std::vector; +} + +%template( +uint32_t_vector +) std::vector; %ignore KeyedCompleteTestType::unbounded_sequence_int64_field(std::vector&&); @@ -1503,7 +1752,11 @@ { return self->data(); } -}%template(int64_t_vector) std::vector; +} + +%template( +int64_t_vector +) std::vector; %ignore KeyedCompleteTestType::unbounded_sequence_uint64_field(std::vector&&); @@ -1517,7 +1770,11 @@ { return self->data(); } -}%template(uint64_t_vector) std::vector; +} + +%template( +uint64_t_vector +) std::vector; %ignore KeyedCompleteTestType::unbounded_sequence_float_field(std::vector&&); @@ -1531,7 +1788,11 @@ { return self->data(); } -}%template(float_vector) std::vector; +} + +%template( +float_vector +) std::vector; %ignore KeyedCompleteTestType::unbounded_sequence_double_field(std::vector&&); @@ -1545,7 +1806,11 @@ { return self->data(); } -}%template(double_vector) std::vector; +} + +%template( +double_vector +) std::vector; %ignore KeyedCompleteTestType::unbounded_sequence_bool_field(std::vector&&); @@ -1553,7 +1818,9 @@ // Const accesors produced constant enums instead of arrays/dictionaries when used // We ignore them to prevent this %ignore KeyedCompleteTestType::unbounded_sequence_bool_field() const; -%template(bool_vector) std::vector; +%template( +bool_vector +) std::vector; %ignore KeyedCompleteTestType::unbounded_sequence_enum_field(std::vector&&); @@ -1567,7 +1834,11 @@ { return self->data(); } -}%template(Color_vector) std::vector; +} + +%template( +Color_vector +) std::vector; %ignore KeyedCompleteTestType::unbounded_sequence_enum2_field(std::vector&&); @@ -1581,7 +1852,11 @@ { return self->data(); } -}%template(Material_vector) std::vector; +} + +%template( +Material_vector +) std::vector; %ignore KeyedCompleteTestType::unbounded_sequence_struct_field(std::vector&&); @@ -1589,7 +1864,9 @@ // Const accesors produced constant enums instead of arrays/dictionaries when used // We ignore them to prevent this %ignore KeyedCompleteTestType::unbounded_sequence_struct_field() const; -%template(StructType_vector) std::vector; +%template( +StructType_vector +) std::vector; %template(_KeyedCompleteTestTypeSeq) eprosima::fastdds::dds::LoanableTypedCollection; diff --git a/fastdds_python/test/types/test_completeCdrAux.hpp b/fastdds_python/test/types/test_completeCdrAux.hpp new file mode 100644 index 00000000..78b6d2a0 --- /dev/null +++ b/fastdds_python/test/types/test_completeCdrAux.hpp @@ -0,0 +1,63 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file test_completeCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_TEST_COMPLETECDRAUX_HPP_ +#define _FAST_DDS_GENERATED_TEST_COMPLETECDRAUX_HPP_ + +#include "test_complete.h" + +constexpr uint32_t CompleteTestType_max_cdr_typesize {41752UL}; +constexpr uint32_t CompleteTestType_max_key_cdr_typesize {0UL}; + +constexpr uint32_t StructType_max_cdr_typesize {328UL}; +constexpr uint32_t StructType_max_key_cdr_typesize {0UL}; + + + +constexpr uint32_t KeyedCompleteTestType_max_cdr_typesize {41752UL}; +constexpr uint32_t KeyedCompleteTestType_max_key_cdr_typesize {4UL}; + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const StructType& data); + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const CompleteTestType& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const KeyedCompleteTestType& data); + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_TEST_COMPLETECDRAUX_HPP_ \ No newline at end of file diff --git a/fastdds_python/test/types/test_completeCdrAux.ipp b/fastdds_python/test/types/test_completeCdrAux.ipp new file mode 100644 index 00000000..dd558274 --- /dev/null +++ b/fastdds_python/test/types/test_completeCdrAux.ipp @@ -0,0 +1,1341 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file test_completeCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_TEST_COMPLETECDRAUX_IPP_ +#define _FAST_DDS_GENERATED_TEST_COMPLETECDRAUX_IPP_ + +#include "test_completeCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const StructType& data, + size_t& current_alignment) +{ + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.char_field(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.uint8_field(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), + data.int16_field(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(3), + data.uint16_field(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(4), + data.int32_field(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(5), + data.uint32_field(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(6), + data.int64_field(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(7), + data.uint64_field(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(8), + data.float_field(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(9), + data.double_field(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(10), + data.bool_field(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(11), + data.string_field(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(12), + data.enum_field(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(13), + data.enum2_field(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const StructType& data) +{ + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.char_field() + << eprosima::fastcdr::MemberId(1) << data.uint8_field() + << eprosima::fastcdr::MemberId(2) << data.int16_field() + << eprosima::fastcdr::MemberId(3) << data.uint16_field() + << eprosima::fastcdr::MemberId(4) << data.int32_field() + << eprosima::fastcdr::MemberId(5) << data.uint32_field() + << eprosima::fastcdr::MemberId(6) << data.int64_field() + << eprosima::fastcdr::MemberId(7) << data.uint64_field() + << eprosima::fastcdr::MemberId(8) << data.float_field() + << eprosima::fastcdr::MemberId(9) << data.double_field() + << eprosima::fastcdr::MemberId(10) << data.bool_field() + << eprosima::fastcdr::MemberId(11) << data.string_field() + << eprosima::fastcdr::MemberId(12) << data.enum_field() + << eprosima::fastcdr::MemberId(13) << data.enum2_field() +; + + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + StructType& data) +{ + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.char_field(); + break; + + case 1: + dcdr >> data.uint8_field(); + break; + + case 2: + dcdr >> data.int16_field(); + break; + + case 3: + dcdr >> data.uint16_field(); + break; + + case 4: + dcdr >> data.int32_field(); + break; + + case 5: + dcdr >> data.uint32_field(); + break; + + case 6: + dcdr >> data.int64_field(); + break; + + case 7: + dcdr >> data.uint64_field(); + break; + + case 8: + dcdr >> data.float_field(); + break; + + case 9: + dcdr >> data.double_field(); + break; + + case 10: + dcdr >> data.bool_field(); + break; + + case 11: + dcdr >> data.string_field(); + break; + + case 12: + dcdr >> data.enum_field(); + break; + + case 13: + dcdr >> data.enum2_field(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const StructType& data) +{ + static_cast(scdr); + static_cast(data); +} + + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const CompleteTestType& data, + size_t& current_alignment) +{ + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.char_field(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.uint8_field(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), + data.int16_field(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(3), + data.uint16_field(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(4), + data.int32_field(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(5), + data.uint32_field(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(6), + data.int64_field(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(7), + data.uint64_field(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(8), + data.float_field(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(9), + data.double_field(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(10), + data.bool_field(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(11), + data.string_field(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(12), + data.enum_field(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(13), + data.enum2_field(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(14), + data.struct_field(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(15), + data.array_char_field(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(16), + data.array_uint8_field(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(17), + data.array_int16_field(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(18), + data.array_uint16_field(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(19), + data.array_int32_field(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(20), + data.array_uint32_field(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(21), + data.array_int64_field(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(22), + data.array_uint64_field(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(23), + data.array_float_field(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(24), + data.array_double_field(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(25), + data.array_bool_field(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(26), + data.array_enum_field(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(27), + data.array_enum2_field(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(28), + data.array_struct_field(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(29), + data.bounded_sequence_char_field(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(30), + data.bounded_sequence_uint8_field(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(31), + data.bounded_sequence_int16_field(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(32), + data.bounded_sequence_uint16_field(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(33), + data.bounded_sequence_int32_field(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(34), + data.bounded_sequence_uint32_field(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(35), + data.bounded_sequence_int64_field(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(36), + data.bounded_sequence_uint64_field(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(37), + data.bounded_sequence_float_field(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(38), + data.bounded_sequence_double_field(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(39), + data.bounded_sequence_bool_field(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(40), + data.bounded_sequence_enum_field(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(41), + data.bounded_sequence_enum2_field(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(42), + data.bounded_sequence_struct_field(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(43), + data.unbounded_sequence_char_field(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(44), + data.unbounded_sequence_uint8_field(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(45), + data.unbounded_sequence_int16_field(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(46), + data.unbounded_sequence_uint16_field(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(47), + data.unbounded_sequence_int32_field(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(48), + data.unbounded_sequence_uint32_field(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(49), + data.unbounded_sequence_int64_field(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(50), + data.unbounded_sequence_uint64_field(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(51), + data.unbounded_sequence_float_field(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(52), + data.unbounded_sequence_double_field(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(53), + data.unbounded_sequence_bool_field(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(54), + data.unbounded_sequence_enum_field(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(55), + data.unbounded_sequence_enum2_field(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(56), + data.unbounded_sequence_struct_field(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const CompleteTestType& data) +{ + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.char_field() + << eprosima::fastcdr::MemberId(1) << data.uint8_field() + << eprosima::fastcdr::MemberId(2) << data.int16_field() + << eprosima::fastcdr::MemberId(3) << data.uint16_field() + << eprosima::fastcdr::MemberId(4) << data.int32_field() + << eprosima::fastcdr::MemberId(5) << data.uint32_field() + << eprosima::fastcdr::MemberId(6) << data.int64_field() + << eprosima::fastcdr::MemberId(7) << data.uint64_field() + << eprosima::fastcdr::MemberId(8) << data.float_field() + << eprosima::fastcdr::MemberId(9) << data.double_field() + << eprosima::fastcdr::MemberId(10) << data.bool_field() + << eprosima::fastcdr::MemberId(11) << data.string_field() + << eprosima::fastcdr::MemberId(12) << data.enum_field() + << eprosima::fastcdr::MemberId(13) << data.enum2_field() + << eprosima::fastcdr::MemberId(14) << data.struct_field() + << eprosima::fastcdr::MemberId(15) << data.array_char_field() + << eprosima::fastcdr::MemberId(16) << data.array_uint8_field() + << eprosima::fastcdr::MemberId(17) << data.array_int16_field() + << eprosima::fastcdr::MemberId(18) << data.array_uint16_field() + << eprosima::fastcdr::MemberId(19) << data.array_int32_field() + << eprosima::fastcdr::MemberId(20) << data.array_uint32_field() + << eprosima::fastcdr::MemberId(21) << data.array_int64_field() + << eprosima::fastcdr::MemberId(22) << data.array_uint64_field() + << eprosima::fastcdr::MemberId(23) << data.array_float_field() + << eprosima::fastcdr::MemberId(24) << data.array_double_field() + << eprosima::fastcdr::MemberId(25) << data.array_bool_field() + << eprosima::fastcdr::MemberId(26) << data.array_enum_field() + << eprosima::fastcdr::MemberId(27) << data.array_enum2_field() + << eprosima::fastcdr::MemberId(28) << data.array_struct_field() + << eprosima::fastcdr::MemberId(29) << data.bounded_sequence_char_field() + << eprosima::fastcdr::MemberId(30) << data.bounded_sequence_uint8_field() + << eprosima::fastcdr::MemberId(31) << data.bounded_sequence_int16_field() + << eprosima::fastcdr::MemberId(32) << data.bounded_sequence_uint16_field() + << eprosima::fastcdr::MemberId(33) << data.bounded_sequence_int32_field() + << eprosima::fastcdr::MemberId(34) << data.bounded_sequence_uint32_field() + << eprosima::fastcdr::MemberId(35) << data.bounded_sequence_int64_field() + << eprosima::fastcdr::MemberId(36) << data.bounded_sequence_uint64_field() + << eprosima::fastcdr::MemberId(37) << data.bounded_sequence_float_field() + << eprosima::fastcdr::MemberId(38) << data.bounded_sequence_double_field() + << eprosima::fastcdr::MemberId(39) << data.bounded_sequence_bool_field() + << eprosima::fastcdr::MemberId(40) << data.bounded_sequence_enum_field() + << eprosima::fastcdr::MemberId(41) << data.bounded_sequence_enum2_field() + << eprosima::fastcdr::MemberId(42) << data.bounded_sequence_struct_field() + << eprosima::fastcdr::MemberId(43) << data.unbounded_sequence_char_field() + << eprosima::fastcdr::MemberId(44) << data.unbounded_sequence_uint8_field() + << eprosima::fastcdr::MemberId(45) << data.unbounded_sequence_int16_field() + << eprosima::fastcdr::MemberId(46) << data.unbounded_sequence_uint16_field() + << eprosima::fastcdr::MemberId(47) << data.unbounded_sequence_int32_field() + << eprosima::fastcdr::MemberId(48) << data.unbounded_sequence_uint32_field() + << eprosima::fastcdr::MemberId(49) << data.unbounded_sequence_int64_field() + << eprosima::fastcdr::MemberId(50) << data.unbounded_sequence_uint64_field() + << eprosima::fastcdr::MemberId(51) << data.unbounded_sequence_float_field() + << eprosima::fastcdr::MemberId(52) << data.unbounded_sequence_double_field() + << eprosima::fastcdr::MemberId(53) << data.unbounded_sequence_bool_field() + << eprosima::fastcdr::MemberId(54) << data.unbounded_sequence_enum_field() + << eprosima::fastcdr::MemberId(55) << data.unbounded_sequence_enum2_field() + << eprosima::fastcdr::MemberId(56) << data.unbounded_sequence_struct_field() +; + + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + CompleteTestType& data) +{ + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.char_field(); + break; + + case 1: + dcdr >> data.uint8_field(); + break; + + case 2: + dcdr >> data.int16_field(); + break; + + case 3: + dcdr >> data.uint16_field(); + break; + + case 4: + dcdr >> data.int32_field(); + break; + + case 5: + dcdr >> data.uint32_field(); + break; + + case 6: + dcdr >> data.int64_field(); + break; + + case 7: + dcdr >> data.uint64_field(); + break; + + case 8: + dcdr >> data.float_field(); + break; + + case 9: + dcdr >> data.double_field(); + break; + + case 10: + dcdr >> data.bool_field(); + break; + + case 11: + dcdr >> data.string_field(); + break; + + case 12: + dcdr >> data.enum_field(); + break; + + case 13: + dcdr >> data.enum2_field(); + break; + + case 14: + dcdr >> data.struct_field(); + break; + + case 15: + dcdr >> data.array_char_field(); + break; + + case 16: + dcdr >> data.array_uint8_field(); + break; + + case 17: + dcdr >> data.array_int16_field(); + break; + + case 18: + dcdr >> data.array_uint16_field(); + break; + + case 19: + dcdr >> data.array_int32_field(); + break; + + case 20: + dcdr >> data.array_uint32_field(); + break; + + case 21: + dcdr >> data.array_int64_field(); + break; + + case 22: + dcdr >> data.array_uint64_field(); + break; + + case 23: + dcdr >> data.array_float_field(); + break; + + case 24: + dcdr >> data.array_double_field(); + break; + + case 25: + dcdr >> data.array_bool_field(); + break; + + case 26: + dcdr >> data.array_enum_field(); + break; + + case 27: + dcdr >> data.array_enum2_field(); + break; + + case 28: + dcdr >> data.array_struct_field(); + break; + + case 29: + dcdr >> data.bounded_sequence_char_field(); + break; + + case 30: + dcdr >> data.bounded_sequence_uint8_field(); + break; + + case 31: + dcdr >> data.bounded_sequence_int16_field(); + break; + + case 32: + dcdr >> data.bounded_sequence_uint16_field(); + break; + + case 33: + dcdr >> data.bounded_sequence_int32_field(); + break; + + case 34: + dcdr >> data.bounded_sequence_uint32_field(); + break; + + case 35: + dcdr >> data.bounded_sequence_int64_field(); + break; + + case 36: + dcdr >> data.bounded_sequence_uint64_field(); + break; + + case 37: + dcdr >> data.bounded_sequence_float_field(); + break; + + case 38: + dcdr >> data.bounded_sequence_double_field(); + break; + + case 39: + dcdr >> data.bounded_sequence_bool_field(); + break; + + case 40: + dcdr >> data.bounded_sequence_enum_field(); + break; + + case 41: + dcdr >> data.bounded_sequence_enum2_field(); + break; + + case 42: + dcdr >> data.bounded_sequence_struct_field(); + break; + + case 43: + dcdr >> data.unbounded_sequence_char_field(); + break; + + case 44: + dcdr >> data.unbounded_sequence_uint8_field(); + break; + + case 45: + dcdr >> data.unbounded_sequence_int16_field(); + break; + + case 46: + dcdr >> data.unbounded_sequence_uint16_field(); + break; + + case 47: + dcdr >> data.unbounded_sequence_int32_field(); + break; + + case 48: + dcdr >> data.unbounded_sequence_uint32_field(); + break; + + case 49: + dcdr >> data.unbounded_sequence_int64_field(); + break; + + case 50: + dcdr >> data.unbounded_sequence_uint64_field(); + break; + + case 51: + dcdr >> data.unbounded_sequence_float_field(); + break; + + case 52: + dcdr >> data.unbounded_sequence_double_field(); + break; + + case 53: + dcdr >> data.unbounded_sequence_bool_field(); + break; + + case 54: + dcdr >> data.unbounded_sequence_enum_field(); + break; + + case 55: + dcdr >> data.unbounded_sequence_enum2_field(); + break; + + case 56: + dcdr >> data.unbounded_sequence_struct_field(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const CompleteTestType& data) +{ + static_cast(scdr); + static_cast(data); +} + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const KeyedCompleteTestType& data, + size_t& current_alignment) +{ + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.id(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.char_field(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), + data.uint8_field(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(3), + data.int16_field(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(4), + data.uint16_field(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(5), + data.int32_field(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(6), + data.uint32_field(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(7), + data.int64_field(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(8), + data.uint64_field(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(9), + data.float_field(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(10), + data.double_field(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(11), + data.bool_field(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(12), + data.string_field(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(13), + data.enum_field(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(14), + data.enum2_field(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(15), + data.struct_field(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(16), + data.array_char_field(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(17), + data.array_uint8_field(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(18), + data.array_int16_field(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(19), + data.array_uint16_field(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(20), + data.array_int32_field(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(21), + data.array_uint32_field(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(22), + data.array_int64_field(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(23), + data.array_uint64_field(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(24), + data.array_float_field(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(25), + data.array_double_field(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(26), + data.array_bool_field(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(27), + data.array_enum_field(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(28), + data.array_enum2_field(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(29), + data.array_struct_field(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(30), + data.bounded_sequence_char_field(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(31), + data.bounded_sequence_uint8_field(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(32), + data.bounded_sequence_int16_field(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(33), + data.bounded_sequence_uint16_field(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(34), + data.bounded_sequence_int32_field(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(35), + data.bounded_sequence_uint32_field(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(36), + data.bounded_sequence_int64_field(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(37), + data.bounded_sequence_uint64_field(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(38), + data.bounded_sequence_float_field(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(39), + data.bounded_sequence_double_field(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(40), + data.bounded_sequence_bool_field(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(41), + data.bounded_sequence_enum_field(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(42), + data.bounded_sequence_enum2_field(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(43), + data.bounded_sequence_struct_field(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(44), + data.unbounded_sequence_char_field(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(45), + data.unbounded_sequence_uint8_field(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(46), + data.unbounded_sequence_int16_field(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(47), + data.unbounded_sequence_uint16_field(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(48), + data.unbounded_sequence_int32_field(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(49), + data.unbounded_sequence_uint32_field(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(50), + data.unbounded_sequence_int64_field(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(51), + data.unbounded_sequence_uint64_field(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(52), + data.unbounded_sequence_float_field(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(53), + data.unbounded_sequence_double_field(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(54), + data.unbounded_sequence_bool_field(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(55), + data.unbounded_sequence_enum_field(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(56), + data.unbounded_sequence_enum2_field(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(57), + data.unbounded_sequence_struct_field(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const KeyedCompleteTestType& data) +{ + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.id() + << eprosima::fastcdr::MemberId(1) << data.char_field() + << eprosima::fastcdr::MemberId(2) << data.uint8_field() + << eprosima::fastcdr::MemberId(3) << data.int16_field() + << eprosima::fastcdr::MemberId(4) << data.uint16_field() + << eprosima::fastcdr::MemberId(5) << data.int32_field() + << eprosima::fastcdr::MemberId(6) << data.uint32_field() + << eprosima::fastcdr::MemberId(7) << data.int64_field() + << eprosima::fastcdr::MemberId(8) << data.uint64_field() + << eprosima::fastcdr::MemberId(9) << data.float_field() + << eprosima::fastcdr::MemberId(10) << data.double_field() + << eprosima::fastcdr::MemberId(11) << data.bool_field() + << eprosima::fastcdr::MemberId(12) << data.string_field() + << eprosima::fastcdr::MemberId(13) << data.enum_field() + << eprosima::fastcdr::MemberId(14) << data.enum2_field() + << eprosima::fastcdr::MemberId(15) << data.struct_field() + << eprosima::fastcdr::MemberId(16) << data.array_char_field() + << eprosima::fastcdr::MemberId(17) << data.array_uint8_field() + << eprosima::fastcdr::MemberId(18) << data.array_int16_field() + << eprosima::fastcdr::MemberId(19) << data.array_uint16_field() + << eprosima::fastcdr::MemberId(20) << data.array_int32_field() + << eprosima::fastcdr::MemberId(21) << data.array_uint32_field() + << eprosima::fastcdr::MemberId(22) << data.array_int64_field() + << eprosima::fastcdr::MemberId(23) << data.array_uint64_field() + << eprosima::fastcdr::MemberId(24) << data.array_float_field() + << eprosima::fastcdr::MemberId(25) << data.array_double_field() + << eprosima::fastcdr::MemberId(26) << data.array_bool_field() + << eprosima::fastcdr::MemberId(27) << data.array_enum_field() + << eprosima::fastcdr::MemberId(28) << data.array_enum2_field() + << eprosima::fastcdr::MemberId(29) << data.array_struct_field() + << eprosima::fastcdr::MemberId(30) << data.bounded_sequence_char_field() + << eprosima::fastcdr::MemberId(31) << data.bounded_sequence_uint8_field() + << eprosima::fastcdr::MemberId(32) << data.bounded_sequence_int16_field() + << eprosima::fastcdr::MemberId(33) << data.bounded_sequence_uint16_field() + << eprosima::fastcdr::MemberId(34) << data.bounded_sequence_int32_field() + << eprosima::fastcdr::MemberId(35) << data.bounded_sequence_uint32_field() + << eprosima::fastcdr::MemberId(36) << data.bounded_sequence_int64_field() + << eprosima::fastcdr::MemberId(37) << data.bounded_sequence_uint64_field() + << eprosima::fastcdr::MemberId(38) << data.bounded_sequence_float_field() + << eprosima::fastcdr::MemberId(39) << data.bounded_sequence_double_field() + << eprosima::fastcdr::MemberId(40) << data.bounded_sequence_bool_field() + << eprosima::fastcdr::MemberId(41) << data.bounded_sequence_enum_field() + << eprosima::fastcdr::MemberId(42) << data.bounded_sequence_enum2_field() + << eprosima::fastcdr::MemberId(43) << data.bounded_sequence_struct_field() + << eprosima::fastcdr::MemberId(44) << data.unbounded_sequence_char_field() + << eprosima::fastcdr::MemberId(45) << data.unbounded_sequence_uint8_field() + << eprosima::fastcdr::MemberId(46) << data.unbounded_sequence_int16_field() + << eprosima::fastcdr::MemberId(47) << data.unbounded_sequence_uint16_field() + << eprosima::fastcdr::MemberId(48) << data.unbounded_sequence_int32_field() + << eprosima::fastcdr::MemberId(49) << data.unbounded_sequence_uint32_field() + << eprosima::fastcdr::MemberId(50) << data.unbounded_sequence_int64_field() + << eprosima::fastcdr::MemberId(51) << data.unbounded_sequence_uint64_field() + << eprosima::fastcdr::MemberId(52) << data.unbounded_sequence_float_field() + << eprosima::fastcdr::MemberId(53) << data.unbounded_sequence_double_field() + << eprosima::fastcdr::MemberId(54) << data.unbounded_sequence_bool_field() + << eprosima::fastcdr::MemberId(55) << data.unbounded_sequence_enum_field() + << eprosima::fastcdr::MemberId(56) << data.unbounded_sequence_enum2_field() + << eprosima::fastcdr::MemberId(57) << data.unbounded_sequence_struct_field() +; + + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + KeyedCompleteTestType& data) +{ + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.id(); + break; + + case 1: + dcdr >> data.char_field(); + break; + + case 2: + dcdr >> data.uint8_field(); + break; + + case 3: + dcdr >> data.int16_field(); + break; + + case 4: + dcdr >> data.uint16_field(); + break; + + case 5: + dcdr >> data.int32_field(); + break; + + case 6: + dcdr >> data.uint32_field(); + break; + + case 7: + dcdr >> data.int64_field(); + break; + + case 8: + dcdr >> data.uint64_field(); + break; + + case 9: + dcdr >> data.float_field(); + break; + + case 10: + dcdr >> data.double_field(); + break; + + case 11: + dcdr >> data.bool_field(); + break; + + case 12: + dcdr >> data.string_field(); + break; + + case 13: + dcdr >> data.enum_field(); + break; + + case 14: + dcdr >> data.enum2_field(); + break; + + case 15: + dcdr >> data.struct_field(); + break; + + case 16: + dcdr >> data.array_char_field(); + break; + + case 17: + dcdr >> data.array_uint8_field(); + break; + + case 18: + dcdr >> data.array_int16_field(); + break; + + case 19: + dcdr >> data.array_uint16_field(); + break; + + case 20: + dcdr >> data.array_int32_field(); + break; + + case 21: + dcdr >> data.array_uint32_field(); + break; + + case 22: + dcdr >> data.array_int64_field(); + break; + + case 23: + dcdr >> data.array_uint64_field(); + break; + + case 24: + dcdr >> data.array_float_field(); + break; + + case 25: + dcdr >> data.array_double_field(); + break; + + case 26: + dcdr >> data.array_bool_field(); + break; + + case 27: + dcdr >> data.array_enum_field(); + break; + + case 28: + dcdr >> data.array_enum2_field(); + break; + + case 29: + dcdr >> data.array_struct_field(); + break; + + case 30: + dcdr >> data.bounded_sequence_char_field(); + break; + + case 31: + dcdr >> data.bounded_sequence_uint8_field(); + break; + + case 32: + dcdr >> data.bounded_sequence_int16_field(); + break; + + case 33: + dcdr >> data.bounded_sequence_uint16_field(); + break; + + case 34: + dcdr >> data.bounded_sequence_int32_field(); + break; + + case 35: + dcdr >> data.bounded_sequence_uint32_field(); + break; + + case 36: + dcdr >> data.bounded_sequence_int64_field(); + break; + + case 37: + dcdr >> data.bounded_sequence_uint64_field(); + break; + + case 38: + dcdr >> data.bounded_sequence_float_field(); + break; + + case 39: + dcdr >> data.bounded_sequence_double_field(); + break; + + case 40: + dcdr >> data.bounded_sequence_bool_field(); + break; + + case 41: + dcdr >> data.bounded_sequence_enum_field(); + break; + + case 42: + dcdr >> data.bounded_sequence_enum2_field(); + break; + + case 43: + dcdr >> data.bounded_sequence_struct_field(); + break; + + case 44: + dcdr >> data.unbounded_sequence_char_field(); + break; + + case 45: + dcdr >> data.unbounded_sequence_uint8_field(); + break; + + case 46: + dcdr >> data.unbounded_sequence_int16_field(); + break; + + case 47: + dcdr >> data.unbounded_sequence_uint16_field(); + break; + + case 48: + dcdr >> data.unbounded_sequence_int32_field(); + break; + + case 49: + dcdr >> data.unbounded_sequence_uint32_field(); + break; + + case 50: + dcdr >> data.unbounded_sequence_int64_field(); + break; + + case 51: + dcdr >> data.unbounded_sequence_uint64_field(); + break; + + case 52: + dcdr >> data.unbounded_sequence_float_field(); + break; + + case 53: + dcdr >> data.unbounded_sequence_double_field(); + break; + + case 54: + dcdr >> data.unbounded_sequence_bool_field(); + break; + + case 55: + dcdr >> data.unbounded_sequence_enum_field(); + break; + + case 56: + dcdr >> data.unbounded_sequence_enum2_field(); + break; + + case 57: + dcdr >> data.unbounded_sequence_struct_field(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const KeyedCompleteTestType& data) +{ + static_cast(scdr); + static_cast(data); + scdr << data.id(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +} + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_TEST_COMPLETECDRAUX_IPP_ \ No newline at end of file diff --git a/fastdds_python/test/types/test_completePubSubTypes.cxx b/fastdds_python/test/types/test_completePubSubTypes.cxx index 98ca9e74..00696b4d 100644 --- a/fastdds_python/test/types/test_completePubSubTypes.cxx +++ b/fastdds_python/test/types/test_completePubSubTypes.cxx @@ -16,29 +16,29 @@ * @file test_completePubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen. */ #include #include +#include #include "test_completePubSubTypes.h" +#include "test_completeCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; - - +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; StructTypePubSubType::StructTypePubSubType() { setName("StructType"); - auto type_size = StructType::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = StructType::isKeyDefined(); - size_t keyLength = StructType::getKeyMaxCdrSerializedSize() > 16 ? - StructType::getKeyMaxCdrSerializedSize() : 16; + uint32_t type_size = StructType_max_cdr_typesize; + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; + uint32_t keyLength = StructType_max_key_cdr_typesize > 16 ? StructType_max_key_cdr_typesize : 16; m_keyBuffer = reinterpret_cast(malloc(keyLength)); memset(m_keyBuffer, 0, keyLength); } @@ -53,22 +53,29 @@ StructTypePubSubType::~StructTypePubSubType() bool StructTypePubSubType::serialize( void* data, - SerializedPayload_t* payload) + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) { StructType* p_type = static_cast(data); // Object that manages the raw buffer. eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); try { // Serialize encapsulation ser.serialize_encapsulation(); // Serialize the object. - p_type->serialize(ser); + ser << *p_type; } catch (eprosima::fastcdr::exception::Exception& /*exception*/) { @@ -76,7 +83,7 @@ bool StructTypePubSubType::serialize( } // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); + payload->length = static_cast(ser.get_serialized_data_length()); return true; } @@ -93,14 +100,14 @@ bool StructTypePubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); // Deserialize encapsulation. deser.read_encapsulation(); payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; // Deserialize the object. - p_type->deserialize(deser); + deser >> *p_type; } catch (eprosima::fastcdr::exception::Exception& /*exception*/) { @@ -111,12 +118,18 @@ bool StructTypePubSubType::deserialize( } std::function StructTypePubSubType::getSerializedSizeProvider( - void* data) + void* data, + DataRepresentationId_t data_representation) { - return [data]() -> uint32_t + return [data, data_representation]() -> uint32_t { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; }; } @@ -145,15 +158,15 @@ bool StructTypePubSubType::getKey( // Object that manages the raw buffer. eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - StructType::getKeyMaxCdrSerializedSize()); + StructType_max_key_cdr_typesize); // Object that serializes the data. eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || StructType::getKeyMaxCdrSerializedSize() > 16) + eprosima::fastcdr::serialize_key(ser, *p_type); + if (force_md5 || StructType_max_key_cdr_typesize > 16) { m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -175,12 +188,11 @@ bool StructTypePubSubType::getKey( CompleteTestTypePubSubType::CompleteTestTypePubSubType() { setName("CompleteTestType"); - auto type_size = CompleteTestType::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = CompleteTestType::isKeyDefined(); - size_t keyLength = CompleteTestType::getKeyMaxCdrSerializedSize() > 16 ? - CompleteTestType::getKeyMaxCdrSerializedSize() : 16; + uint32_t type_size = CompleteTestType_max_cdr_typesize; + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; + uint32_t keyLength = CompleteTestType_max_key_cdr_typesize > 16 ? CompleteTestType_max_key_cdr_typesize : 16; m_keyBuffer = reinterpret_cast(malloc(keyLength)); memset(m_keyBuffer, 0, keyLength); } @@ -195,22 +207,29 @@ CompleteTestTypePubSubType::~CompleteTestTypePubSubType() bool CompleteTestTypePubSubType::serialize( void* data, - SerializedPayload_t* payload) + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) { CompleteTestType* p_type = static_cast(data); // Object that manages the raw buffer. eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); try { // Serialize encapsulation ser.serialize_encapsulation(); // Serialize the object. - p_type->serialize(ser); + ser << *p_type; } catch (eprosima::fastcdr::exception::Exception& /*exception*/) { @@ -218,7 +237,7 @@ bool CompleteTestTypePubSubType::serialize( } // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); + payload->length = static_cast(ser.get_serialized_data_length()); return true; } @@ -235,14 +254,14 @@ bool CompleteTestTypePubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); // Deserialize encapsulation. deser.read_encapsulation(); payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; // Deserialize the object. - p_type->deserialize(deser); + deser >> *p_type; } catch (eprosima::fastcdr::exception::Exception& /*exception*/) { @@ -253,12 +272,18 @@ bool CompleteTestTypePubSubType::deserialize( } std::function CompleteTestTypePubSubType::getSerializedSizeProvider( - void* data) + void* data, + DataRepresentationId_t data_representation) { - return [data]() -> uint32_t + return [data, data_representation]() -> uint32_t { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; }; } @@ -287,15 +312,15 @@ bool CompleteTestTypePubSubType::getKey( // Object that manages the raw buffer. eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - CompleteTestType::getKeyMaxCdrSerializedSize()); + CompleteTestType_max_key_cdr_typesize); // Object that serializes the data. eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || CompleteTestType::getKeyMaxCdrSerializedSize() > 16) + eprosima::fastcdr::serialize_key(ser, *p_type); + if (force_md5 || CompleteTestType_max_key_cdr_typesize > 16) { m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -315,12 +340,11 @@ bool CompleteTestTypePubSubType::getKey( KeyedCompleteTestTypePubSubType::KeyedCompleteTestTypePubSubType() { setName("KeyedCompleteTestType"); - auto type_size = KeyedCompleteTestType::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = KeyedCompleteTestType::isKeyDefined(); - size_t keyLength = KeyedCompleteTestType::getKeyMaxCdrSerializedSize() > 16 ? - KeyedCompleteTestType::getKeyMaxCdrSerializedSize() : 16; + uint32_t type_size = KeyedCompleteTestType_max_cdr_typesize; + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = true; + uint32_t keyLength = KeyedCompleteTestType_max_key_cdr_typesize > 16 ? KeyedCompleteTestType_max_key_cdr_typesize : 16; m_keyBuffer = reinterpret_cast(malloc(keyLength)); memset(m_keyBuffer, 0, keyLength); } @@ -335,22 +359,29 @@ KeyedCompleteTestTypePubSubType::~KeyedCompleteTestTypePubSubType() bool KeyedCompleteTestTypePubSubType::serialize( void* data, - SerializedPayload_t* payload) + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) { KeyedCompleteTestType* p_type = static_cast(data); // Object that manages the raw buffer. eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); try { // Serialize encapsulation ser.serialize_encapsulation(); // Serialize the object. - p_type->serialize(ser); + ser << *p_type; } catch (eprosima::fastcdr::exception::Exception& /*exception*/) { @@ -358,7 +389,7 @@ bool KeyedCompleteTestTypePubSubType::serialize( } // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); + payload->length = static_cast(ser.get_serialized_data_length()); return true; } @@ -375,14 +406,14 @@ bool KeyedCompleteTestTypePubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); // Deserialize encapsulation. deser.read_encapsulation(); payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; // Deserialize the object. - p_type->deserialize(deser); + deser >> *p_type; } catch (eprosima::fastcdr::exception::Exception& /*exception*/) { @@ -393,12 +424,18 @@ bool KeyedCompleteTestTypePubSubType::deserialize( } std::function KeyedCompleteTestTypePubSubType::getSerializedSizeProvider( - void* data) + void* data, + DataRepresentationId_t data_representation) { - return [data]() -> uint32_t + return [data, data_representation]() -> uint32_t { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; }; } @@ -427,15 +464,15 @@ bool KeyedCompleteTestTypePubSubType::getKey( // Object that manages the raw buffer. eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - KeyedCompleteTestType::getKeyMaxCdrSerializedSize()); + KeyedCompleteTestType_max_key_cdr_typesize); // Object that serializes the data. eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || KeyedCompleteTestType::getKeyMaxCdrSerializedSize() > 16) + eprosima::fastcdr::serialize_key(ser, *p_type); + if (force_md5 || KeyedCompleteTestType_max_key_cdr_typesize > 16) { m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { diff --git a/fastdds_python/test/types/test_completePubSubTypes.h b/fastdds_python/test/types/test_completePubSubTypes.h index 34268e68..9a9b2b92 100644 --- a/fastdds_python/test/types/test_completePubSubTypes.h +++ b/fastdds_python/test/types/test_completePubSubTypes.h @@ -16,27 +16,28 @@ * @file test_completePubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen. */ #ifndef _FAST_DDS_GENERATED_TEST_COMPLETE_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_TEST_COMPLETE_PUBSUBTYPES_H_ +#include #include +#include +#include #include #include "test_complete.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) #error \ Generated test_complete is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER - - /*! * @brief This class represents the TopicDataType of the type StructType defined by the user in the IDL file. * @ingroup test_complete @@ -49,27 +50,42 @@ class StructTypePubSubType : public eprosima::fastdds::dds::TopicDataType eProsima_user_DllExport StructTypePubSubType(); - eProsima_user_DllExport virtual ~StructTypePubSubType() override; + eProsima_user_DllExport ~StructTypePubSubType() override; - eProsima_user_DllExport virtual bool serialize( + eProsima_user_DllExport bool serialize( void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool deserialize( + eProsima_user_DllExport bool serialize( + void* data, eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, void* data) override; - eProsima_user_DllExport virtual bool getKey( + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( void* data, eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, bool force_md5 = false) override; - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport void* createData() override; - eProsima_user_DllExport virtual void deleteData( + eProsima_user_DllExport void deleteData( void* data) override; #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED @@ -86,13 +102,20 @@ class StructTypePubSubType : public eprosima::fastdds::dds::TopicDataType return false; } + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE eProsima_user_DllExport inline bool construct_sample( void* memory) const override { - (void)memory; + static_cast(memory); return false; } @@ -117,27 +140,42 @@ class CompleteTestTypePubSubType : public eprosima::fastdds::dds::TopicDataType eProsima_user_DllExport CompleteTestTypePubSubType(); - eProsima_user_DllExport virtual ~CompleteTestTypePubSubType() override; + eProsima_user_DllExport ~CompleteTestTypePubSubType() override; - eProsima_user_DllExport virtual bool serialize( + eProsima_user_DllExport bool serialize( void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool deserialize( + eProsima_user_DllExport bool serialize( + void* data, eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, void* data) override; - eProsima_user_DllExport virtual bool getKey( + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( void* data, eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, bool force_md5 = false) override; - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport void* createData() override; - eProsima_user_DllExport virtual void deleteData( + eProsima_user_DllExport void deleteData( void* data) override; #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED @@ -154,13 +192,20 @@ class CompleteTestTypePubSubType : public eprosima::fastdds::dds::TopicDataType return false; } + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE eProsima_user_DllExport inline bool construct_sample( void* memory) const override { - (void)memory; + static_cast(memory); return false; } @@ -183,27 +228,42 @@ class KeyedCompleteTestTypePubSubType : public eprosima::fastdds::dds::TopicData eProsima_user_DllExport KeyedCompleteTestTypePubSubType(); - eProsima_user_DllExport virtual ~KeyedCompleteTestTypePubSubType() override; + eProsima_user_DllExport ~KeyedCompleteTestTypePubSubType() override; + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool serialize( + eProsima_user_DllExport bool serialize( void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual bool deserialize( + eProsima_user_DllExport bool deserialize( eprosima::fastrtps::rtps::SerializedPayload_t* payload, void* data) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool getKey( + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( void* data, eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, bool force_md5 = false) override; - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport void* createData() override; - eProsima_user_DllExport virtual void deleteData( + eProsima_user_DllExport void deleteData( void* data) override; #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED @@ -220,13 +280,20 @@ class KeyedCompleteTestTypePubSubType : public eprosima::fastdds::dds::TopicData return false; } + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE eProsima_user_DllExport inline bool construct_sample( void* memory) const override { - (void)memory; + static_cast(memory); return false; } diff --git a/fastdds_python/test/types/test_completePubSubTypes.i b/fastdds_python/test/types/test_completePubSubTypes.i index 10d74178..2c68f927 100644 --- a/fastdds_python/test/types/test_completePubSubTypes.i +++ b/fastdds_python/test/types/test_completePubSubTypes.i @@ -16,7 +16,7 @@ * @file test_completePubSubTypes.i * This header file contains the SWIG interface of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen. */ %import(module="fastdds") "fastdds/dds/topic/TopicDataType.hpp"; @@ -25,6 +25,6 @@ #include "test_completePubSubTypes.h" %} -#define GEN_API_VER 1 +#define GEN_API_VER 2 %include "test_completePubSubTypes.h" diff --git a/fastdds_python_examples/CMakeLists.txt b/fastdds_python_examples/CMakeLists.txt index dacfcfa5..bebc570c 100644 --- a/fastdds_python_examples/CMakeLists.txt +++ b/fastdds_python_examples/CMakeLists.txt @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -cmake_minimum_required(VERSION 3.13) +cmake_minimum_required(VERSION 3.22) project(FastDdsPythonExamples) diff --git a/fastdds_python_examples/HelloWorldExample/CMakeLists.txt b/fastdds_python_examples/HelloWorldExample/CMakeLists.txt index 485ef6ff..85030811 100644 --- a/fastdds_python_examples/HelloWorldExample/CMakeLists.txt +++ b/fastdds_python_examples/HelloWorldExample/CMakeLists.txt @@ -1,5 +1,18 @@ - -cmake_minimum_required(VERSION 3.16.3) +# Copyright 2022 Proyectos y Sistemas de Mantenimiento SL (eProsima). +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +cmake_minimum_required(VERSION 3.22) # SWIG: use standard target name. if(POLICY CMP0078) @@ -22,8 +35,8 @@ message(STATUS "Configuring python wrapper for types in HelloWorld...") project(HelloWorld) -find_package(fastcdr REQUIRED) -find_package(fastrtps REQUIRED) +find_package(fastcdr 2 REQUIRED) +find_package(fastrtps 2.12 REQUIRED) set(${PROJECT_NAME}_FILES @@ -74,6 +87,8 @@ include_directories( ${PROJECT_SOURCE_DIR} ) +set_property(SOURCE ${PROJECT_NAME}.i PROPERTY OUTPUT_DIR "${CMAKE_CURRENT_BINARY_DIR}/") + SWIG_ADD_LIBRARY(${${PROJECT_NAME}_MODULE} TYPE SHARED LANGUAGE python @@ -83,12 +98,17 @@ if(UNIX AND CMAKE_SIZEOF_VOID_P EQUAL 8) set_property(TARGET ${${PROJECT_NAME}_MODULE} PROPERTY SWIG_COMPILE_DEFINITIONS SWIGWORDSIZE64) endif() -SWIG_LINK_LIBRARIES(${${PROJECT_NAME}_MODULE} +target_link_libraries(${${PROJECT_NAME}_MODULE} Python3::Module fastrtps ${PROJECT_NAME} ) +set_target_properties(${${PROJECT_NAME}_MODULE} + PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/" + ) + + # Find the installation path execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "from distutils import sysconfig; print(sysconfig.get_python_lib(plat_specific=True, prefix='${CMAKE_INSTALL_PREFIX}'))" OUTPUT_VARIABLE _ABS_PYTHON_MODULE_PATH @@ -107,7 +127,7 @@ install(TARGETS ${PROJECT_NAME} LIBRARY DESTINATION lib/ ARCHIVE DESTINATION lib/ ) -install(TARGETS ${${PROJECT_NAME}_MODULE} DESTINATION ${PYTHON_MODULE_PATH}) +install(TARGETS ${${PROJECT_NAME}_MODULE} DESTINATION ${PYTHON_MODULE_PATH}/) get_property(support_files TARGET ${${PROJECT_NAME}_MODULE} PROPERTY SWIG_SUPPORT_FILES) -install(FILES ${support_files} DESTINATION ${PYTHON_MODULE_PATH}) +install(FILES ${support_files} DESTINATION ${PYTHON_MODULE_PATH}/) diff --git a/fastdds_python_examples/HelloWorldExample/HelloWorld.cxx b/fastdds_python_examples/HelloWorldExample/HelloWorld.cxx index ab32433c..bcda56fb 100644 --- a/fastdds_python_examples/HelloWorldExample/HelloWorld.cxx +++ b/fastdds_python_examples/HelloWorldExample/HelloWorld.cxx @@ -14,9 +14,9 @@ /*! * @file HelloWorld.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen. */ #ifdef _WIN32 @@ -29,27 +29,20 @@ char dummy; #include "HelloWorld.h" #include + #include using namespace eprosima::fastcdr::exception; #include -#define HelloWorld_max_cdr_typesize 264ULL; -#define HelloWorld_max_key_cdr_typesize 0ULL; HelloWorld::HelloWorld() { - // unsigned long m_index - m_index = 0; - // string m_message - m_message =""; } HelloWorld::~HelloWorld() { - - } HelloWorld::HelloWorld( @@ -60,7 +53,7 @@ HelloWorld::HelloWorld( } HelloWorld::HelloWorld( - HelloWorld&& x) noexcept + HelloWorld&& x) noexcept { m_index = x.m_index; m_message = std::move(x.m_message); @@ -89,8 +82,8 @@ HelloWorld& HelloWorld::operator =( bool HelloWorld::operator ==( const HelloWorld& x) const { - - return (m_index == x.m_index && m_message == x.m_message); + return (m_index == x.m_index && + m_message == x.m_message); } bool HelloWorld::operator !=( @@ -99,47 +92,6 @@ bool HelloWorld::operator !=( return !(*this == x); } -size_t HelloWorld::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return HelloWorld_max_cdr_typesize; -} - -size_t HelloWorld::getCdrSerializedSize( - const HelloWorld& data, - size_t current_alignment) -{ - (void)data; - 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) + data.message().size() + 1; - - - return current_alignment - initial_alignment; -} - -void HelloWorld::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_index; - scdr << m_message.c_str(); - -} - -void HelloWorld::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_index; - dcdr >> m_message; -} - /*! * @brief This function sets a value in member index * @param _index New value for member index @@ -168,6 +120,7 @@ uint32_t& HelloWorld::index() return m_index; } + /*! * @brief This function copies the value in member message * @param _message New value to be copied in member message @@ -207,21 +160,5 @@ std::string& HelloWorld::message() } -size_t HelloWorld::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return HelloWorld_max_key_cdr_typesize; -} - -bool HelloWorld::isKeyDefined() -{ - return false; -} - -void HelloWorld::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - +// Include auxiliary functions like for serializing/deserializing. +#include "HelloWorldCdrAux.ipp" diff --git a/fastdds_python_examples/HelloWorldExample/HelloWorld.h b/fastdds_python_examples/HelloWorldExample/HelloWorld.h index f26341d4..0c6d0980 100644 --- a/fastdds_python_examples/HelloWorldExample/HelloWorld.h +++ b/fastdds_python_examples/HelloWorldExample/HelloWorld.h @@ -16,21 +16,23 @@ * @file HelloWorld.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen. */ #ifndef _FAST_DDS_GENERATED_HELLOWORLD_H_ #define _FAST_DDS_GENERATED_HELLOWORLD_H_ - -#include - -#include #include +#include +#include +#include #include #include -#include -#include + +#include +#include + + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -59,10 +61,12 @@ namespace eprosima { namespace fastcdr { class Cdr; +class CdrSizeCalculator; } // namespace fastcdr } // namespace eprosima + /*! * @brief This class represents the structure HelloWorld defined by the user in the IDL file. * @ingroup HelloWorld @@ -142,6 +146,7 @@ class HelloWorld */ eProsima_user_DllExport uint32_t& index(); + /*! * @brief This function copies the value in member message * @param _message New value to be copied in member message @@ -168,66 +173,9 @@ 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. - */ - 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. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const HelloWorld& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - private: - uint32_t m_index; + uint32_t m_index{0}; std::string m_message; }; diff --git a/fastdds_python_examples/HelloWorldExample/HelloWorld.i b/fastdds_python_examples/HelloWorldExample/HelloWorld.i index a1dbdc31..8f6f9575 100644 --- a/fastdds_python_examples/HelloWorldExample/HelloWorld.i +++ b/fastdds_python_examples/HelloWorldExample/HelloWorld.i @@ -16,17 +16,17 @@ * @file HelloWorld.i * This header file contains the SWIG interface of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen. */ %module HelloWorld // SWIG helper modules %include "stdint.i" -%include "std_string.i" -%include "std_vector.i" %include "std_array.i" %include "std_map.i" +%include "std_string.i" +%include "std_vector.i" %include "typemaps.i" // Assignemt operators are ignored, as there is no such thing in Python. @@ -67,6 +67,7 @@ %ignore HelloWorld::index(); %rename("%s") HelloWorld::index() const; + %ignore HelloWorld::message(std::string&&); // Overloaded getter methods shadow each other and are equivalent in python @@ -76,6 +77,7 @@ %rename("%s") HelloWorld::message() const; + %template(_HelloWorldSeq) eprosima::fastdds::dds::LoanableTypedCollection; %template(HelloWorldSeq) eprosima::fastdds::dds::LoanableSequence; %extend eprosima::fastdds::dds::LoanableSequence diff --git a/fastdds_python_examples/HelloWorldExample/HelloWorldCdrAux.hpp b/fastdds_python_examples/HelloWorldExample/HelloWorldCdrAux.hpp new file mode 100644 index 00000000..cf39bf78 --- /dev/null +++ b/fastdds_python_examples/HelloWorldExample/HelloWorldCdrAux.hpp @@ -0,0 +1,45 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file HelloWorldCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_HELLOWORLDCDRAUX_HPP_ +#define _FAST_DDS_GENERATED_HELLOWORLDCDRAUX_HPP_ + +#include "HelloWorld.h" + +constexpr uint32_t HelloWorld_max_cdr_typesize {268UL}; +constexpr uint32_t HelloWorld_max_key_cdr_typesize {0UL}; + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const HelloWorld& data); + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_HELLOWORLDCDRAUX_HPP_ \ No newline at end of file diff --git a/fastdds_python_examples/HelloWorldExample/HelloWorldCdrAux.ipp b/fastdds_python_examples/HelloWorldExample/HelloWorldCdrAux.ipp new file mode 100644 index 00000000..b9461ff5 --- /dev/null +++ b/fastdds_python_examples/HelloWorldExample/HelloWorldCdrAux.ipp @@ -0,0 +1,126 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file HelloWorldCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_HELLOWORLDCDRAUX_IPP_ +#define _FAST_DDS_GENERATED_HELLOWORLDCDRAUX_IPP_ + +#include "HelloWorldCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const HelloWorld& data, + size_t& current_alignment) +{ + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.index(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.message(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const HelloWorld& data) +{ + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.index() + << eprosima::fastcdr::MemberId(1) << data.message() +; + + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + HelloWorld& data) +{ + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.index(); + break; + + case 1: + dcdr >> data.message(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const HelloWorld& data) +{ + static_cast(scdr); + static_cast(data); +} + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_HELLOWORLDCDRAUX_IPP_ \ No newline at end of file diff --git a/fastdds_python_examples/HelloWorldExample/HelloWorldPubSubTypes.cxx b/fastdds_python_examples/HelloWorldExample/HelloWorldPubSubTypes.cxx index c2a00dd2..f4a5ef51 100644 --- a/fastdds_python_examples/HelloWorldExample/HelloWorldPubSubTypes.cxx +++ b/fastdds_python_examples/HelloWorldExample/HelloWorldPubSubTypes.cxx @@ -16,27 +16,29 @@ * @file HelloWorldPubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen. */ #include #include +#include #include "HelloWorldPubSubTypes.h" +#include "HelloWorldCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; HelloWorldPubSubType::HelloWorldPubSubType() { setName("HelloWorld"); - auto type_size = HelloWorld::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = HelloWorld::isKeyDefined(); - size_t keyLength = HelloWorld::getKeyMaxCdrSerializedSize() > 16 ? - HelloWorld::getKeyMaxCdrSerializedSize() : 16; + uint32_t type_size = HelloWorld_max_cdr_typesize; + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; + uint32_t keyLength = HelloWorld_max_key_cdr_typesize > 16 ? HelloWorld_max_key_cdr_typesize : 16; m_keyBuffer = reinterpret_cast(malloc(keyLength)); memset(m_keyBuffer, 0, keyLength); } @@ -51,22 +53,29 @@ HelloWorldPubSubType::~HelloWorldPubSubType() bool HelloWorldPubSubType::serialize( void* data, - SerializedPayload_t* payload) + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) { HelloWorld* p_type = static_cast(data); // Object that manages the raw buffer. eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); try { // Serialize encapsulation ser.serialize_encapsulation(); // Serialize the object. - p_type->serialize(ser); + ser << *p_type; } catch (eprosima::fastcdr::exception::Exception& /*exception*/) { @@ -74,7 +83,7 @@ bool HelloWorldPubSubType::serialize( } // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); + payload->length = static_cast(ser.get_serialized_data_length()); return true; } @@ -91,14 +100,14 @@ bool HelloWorldPubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); // Deserialize encapsulation. deser.read_encapsulation(); payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; // Deserialize the object. - p_type->deserialize(deser); + deser >> *p_type; } catch (eprosima::fastcdr::exception::Exception& /*exception*/) { @@ -109,12 +118,18 @@ bool HelloWorldPubSubType::deserialize( } std::function HelloWorldPubSubType::getSerializedSizeProvider( - void* data) + void* data, + DataRepresentationId_t data_representation) { - return [data]() -> uint32_t + return [data, data_representation]() -> uint32_t { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; }; } @@ -143,15 +158,15 @@ bool HelloWorldPubSubType::getKey( // Object that manages the raw buffer. eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - HelloWorld::getKeyMaxCdrSerializedSize()); + HelloWorld_max_key_cdr_typesize); // Object that serializes the data. eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || HelloWorld::getKeyMaxCdrSerializedSize() > 16) + eprosima::fastcdr::serialize_key(ser, *p_type); + if (force_md5 || HelloWorld_max_key_cdr_typesize > 16) { m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { diff --git a/fastdds_python_examples/HelloWorldExample/HelloWorldPubSubTypes.h b/fastdds_python_examples/HelloWorldExample/HelloWorldPubSubTypes.h index 43d91da1..f6c88d5c 100644 --- a/fastdds_python_examples/HelloWorldExample/HelloWorldPubSubTypes.h +++ b/fastdds_python_examples/HelloWorldExample/HelloWorldPubSubTypes.h @@ -16,20 +16,23 @@ * @file HelloWorldPubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen. */ #ifndef _FAST_DDS_GENERATED_HELLOWORLD_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_HELLOWORLD_PUBSUBTYPES_H_ +#include #include +#include +#include #include #include "HelloWorld.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) #error \ Generated HelloWorld is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER @@ -47,27 +50,42 @@ class HelloWorldPubSubType : public eprosima::fastdds::dds::TopicDataType eProsima_user_DllExport HelloWorldPubSubType(); - eProsima_user_DllExport virtual ~HelloWorldPubSubType() override; + eProsima_user_DllExport ~HelloWorldPubSubType() override; - eProsima_user_DllExport virtual bool serialize( + eProsima_user_DllExport bool serialize( void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool deserialize( + eProsima_user_DllExport bool serialize( + void* data, eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, void* data) override; - eProsima_user_DllExport virtual bool getKey( + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( void* data, eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, bool force_md5 = false) override; - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport void* createData() override; - eProsima_user_DllExport virtual void deleteData( + eProsima_user_DllExport void deleteData( void* data) override; #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED @@ -84,13 +102,20 @@ class HelloWorldPubSubType : public eprosima::fastdds::dds::TopicDataType return false; } + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE eProsima_user_DllExport inline bool construct_sample( void* memory) const override { - (void)memory; + static_cast(memory); return false; } diff --git a/fastdds_python_examples/HelloWorldExample/HelloWorldPubSubTypes.i b/fastdds_python_examples/HelloWorldExample/HelloWorldPubSubTypes.i index 3b334e71..cac4f8c3 100644 --- a/fastdds_python_examples/HelloWorldExample/HelloWorldPubSubTypes.i +++ b/fastdds_python_examples/HelloWorldExample/HelloWorldPubSubTypes.i @@ -16,7 +16,7 @@ * @file HelloWorldPubSubTypes.i * This header file contains the SWIG interface of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen. */ %import(module="fastdds") "fastdds/dds/topic/TopicDataType.hpp"; @@ -25,6 +25,6 @@ #include "HelloWorldPubSubTypes.h" %} -#define GEN_API_VER 1 +#define GEN_API_VER 2 %include "HelloWorldPubSubTypes.h"