From b052c88f8d89a2153733c849ae560b8ba07c26ad Mon Sep 17 00:00:00 2001 From: Eduardo Ponz Segrelles Date: Thu, 16 May 2024 10:24:47 +0200 Subject: [PATCH 01/17] Update mirror job (#127) Signed-off-by: eduponz --- .github/workflows/mirror.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/mirror.yml b/.github/workflows/mirror.yml index b6d5fe60..8805336d 100644 --- a/.github/workflows/mirror.yml +++ b/.github/workflows/mirror.yml @@ -1,22 +1,23 @@ # .github/workflows/mirror.yml +name: Mirror on: push: branches: - - 'main' + - '1.4.x' jobs: mirror_job: runs-on: ubuntu-latest - name: Mirror main branch to compatible minor version branches + name: Mirror 1.4.x branch to compatible version branches strategy: fail-fast: false matrix: dest_branch: - - '1.4.x' + - '1.x' steps: - name: Mirror action step id: mirror uses: eProsima/eProsima-CI/external/mirror-branch-action@v0 with: github-token: ${{ secrets.GITHUB_TOKEN }} - source: 'main' + source: '1.4.x' dest: ${{ matrix.dest_branch }} From cc10e0887e2e7e62381ec5913b0f94648e8bcb51 Mon Sep 17 00:00:00 2001 From: elianalf <62831776+elianalf@users.noreply.github.com> Date: Fri, 17 May 2024 13:56:47 +0200 Subject: [PATCH 02/17] Update GitHub workflow (#129) * Refs #21030: Update versions in github workflow to the last compatible version with fastdds 2.x Signed-off-by: elianalf <62831776+elianalf@users.noreply.github.com> * Refs #21030: Apply suggestions Signed-off-by: elianalf <62831776+elianalf@users.noreply.github.com> --------- Signed-off-by: elianalf <62831776+elianalf@users.noreply.github.com> --- .github/workflows/build_and_test.yml | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index 04c10899..08196f7e 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -14,13 +14,11 @@ on: fastdds_branch: description: 'Fast DDS branch to be used' required: false - default: 'master' + default: '2.14.x' pull_request: push: branches: - - main - schedule: - - cron: '0 0 * * *' + - 1.4.x concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} @@ -36,7 +34,7 @@ jobs: - ${{ github.event.inputs.foonathan_memory_vendor_branch || 'master' }} fastcdr_version: ${{ fromJson(github.event.inputs.fastcdr_versions || '["1.1.x", "master"]') }} fastdds_version: - - ${{ github.event.inputs.fastdds_branch || 'master' }} + - ${{ github.event.inputs.fastdds_branch || '2.14.x' }} env: CXXFLAGS: /MP @@ -155,7 +153,7 @@ jobs: - ${{ github.event.inputs.foonathan_memory_vendor_branch || 'master' }} fastcdr_version: ${{ fromJson(github.event.inputs.fastcdr_versions || '["1.1.x", "master"]') }} fastdds_version: - - ${{ github.event.inputs.fastdds_branch || 'master' }} + - ${{ github.event.inputs.fastdds_branch || '2.14.x' }} steps: From ed1769b4c464eda03cbb2619025caa0e962bc3d7 Mon Sep 17 00:00:00 2001 From: elianalf <62831776+elianalf@users.noreply.github.com> Date: Wed, 5 Jun 2024 20:17:13 +0200 Subject: [PATCH 03/17] Update .repos file (#128) Signed-off-by: elianalf <62831776+elianalf@users.noreply.github.com> --- fastdds_python.repos | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/fastdds_python.repos b/fastdds_python.repos index 0fe5ff75..3d2ec276 100644 --- a/fastdds_python.repos +++ b/fastdds_python.repos @@ -6,16 +6,16 @@ repositories: fastcdr: type: git url: https://github.com/eProsima/Fast-CDR.git - version: master + version: 2.2.x fastdds: type: git url: https://github.com/eProsima/Fast-DDS.git - version: master + version: 2.14.x fastdds_python: type: git url: https://github.com/eProsima/Fast-DDS-python.git - version: main + version: 1.4.x fastddsgen: type: git url: https://github.com/eProsima/Fast-DDS-Gen.git - version: master + version: 3.3.x From 5a7b7185e52d5b0e6c798205f38d23eb40df8fee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Poderoso?= <120394830+JesusPoderoso@users.noreply.github.com> Date: Thu, 6 Jun 2024 17:02:19 +0200 Subject: [PATCH 04/17] Bump version to v1.4.2 (#133) Signed-off-by: JesusPoderoso --- fastdds_python/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fastdds_python/CMakeLists.txt b/fastdds_python/CMakeLists.txt index fd0ebfea..3eedf30c 100644 --- a/fastdds_python/CMakeLists.txt +++ b/fastdds_python/CMakeLists.txt @@ -24,7 +24,7 @@ if(POLICY CMP0086) cmake_policy(SET CMP0086 NEW) endif() -project(fastdds_python VERSION 1.4.1) +project(fastdds_python VERSION 1.4.2) # Set BUILD_TESTING to OFF by default. if(NOT BUILD_TESTING) From bd35305dbacaa286d40add3cfb92181871535316 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Wed, 12 Jun 2024 08:36:43 +0200 Subject: [PATCH 05/17] Use token for ccache action (#136) (#137) Signed-off-by: eduponz (cherry picked from commit cce555d5d3d19d44b53546f448e0ebe2e7bf025b) Co-authored-by: Eduardo Ponz Segrelles --- .github/workflows/build_and_test.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index 08196f7e..14537e5d 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -115,6 +115,7 @@ jobs: uses: eProsima/eProsima-CI/external/setup-ccache-action@v0 with: windows_compile_environment: msvc + api_token: ${{ secrets.GITHUB_TOKEN }} - name: Build workspace uses: eProsima/eProsima-CI/windows/colcon_build@v0 @@ -198,6 +199,8 @@ jobs: - name: Setup ccache uses: eProsima/eProsima-CI/external/setup-ccache-action@v0 + with: + api_token: ${{ secrets.GITHUB_TOKEN }} - name: Build workspace uses: eProsima/eProsima-CI/multiplatform/colcon_build@v0 From 9d1675c2f8e5c103015e66e62390767f482e3644 Mon Sep 17 00:00:00 2001 From: Eduardo Ponz Segrelles Date: Wed, 3 Jul 2024 07:33:20 +0200 Subject: [PATCH 06/17] Remove doxygen warnings (#154) Signed-off-by: eduponz --- .../src/swig/fastdds/dds/domain/DomainParticipant.i | 8 ++++++-- .../src/swig/fastdds/dds/publisher/DataWriter.i | 1 + .../src/swig/fastdds/dds/subscriber/DataReader.i | 7 +++++-- .../src/swig/fastdds/rtps/common/InstanceHandle.i | 1 + 4 files changed, 13 insertions(+), 4 deletions(-) diff --git a/fastdds_python/src/swig/fastdds/dds/domain/DomainParticipant.i b/fastdds_python/src/swig/fastdds/dds/domain/DomainParticipant.i index 4e62f13c..a9f21c47 100644 --- a/fastdds_python/src/swig/fastdds/dds/domain/DomainParticipant.i +++ b/fastdds_python/src/swig/fastdds/dds/domain/DomainParticipant.i @@ -84,7 +84,7 @@ if (nullptr != listener) { Swig::Director* director = SWIG_DIRECTOR_CAST(listener); - + if (nullptr != director) { Py_INCREF(director->swig_get_self()); @@ -93,7 +93,7 @@ if (nullptr != old_listener) { Swig::Director* director = SWIG_DIRECTOR_CAST(old_listener); - + if (nullptr != director) { Py_DECREF(director->swig_get_self()); @@ -288,4 +288,8 @@ %ignore eprosima::fastdds::dds::DomainParticipant::delete_subscriber; %ignore eprosima::fastdds::dds::DomainParticipant::create_subscriber_with_profile; +// Template for std::vector +%template(DomainParticipantVector) std::vector; +%typemap(doctype) std::vector "DomainParticipantVector"; + %include "fastdds/dds/domain/DomainParticipant.hpp" diff --git a/fastdds_python/src/swig/fastdds/dds/publisher/DataWriter.i b/fastdds_python/src/swig/fastdds/dds/publisher/DataWriter.i index 97e0d12c..b2c18500 100644 --- a/fastdds_python/src/swig/fastdds/dds/publisher/DataWriter.i +++ b/fastdds_python/src/swig/fastdds/dds/publisher/DataWriter.i @@ -125,6 +125,7 @@ // Template for std::vector %template(DataWriterVector) std::vector; +%typemap(doctype) std::vector "DataWriterVector"; %include "fastdds/dds/publisher/DataWriter.hpp" diff --git a/fastdds_python/src/swig/fastdds/dds/subscriber/DataReader.i b/fastdds_python/src/swig/fastdds/dds/subscriber/DataReader.i index 37ac006e..eeb63f01 100644 --- a/fastdds_python/src/swig/fastdds/dds/subscriber/DataReader.i +++ b/fastdds_python/src/swig/fastdds/dds/subscriber/DataReader.i @@ -18,7 +18,10 @@ // Template for std::vector %template(DataReaderVector) std::vector; +%typemap(doctype) std::vector "DataReaderVector"; + %template(SampleInfoSeq) eprosima::fastdds::dds::LoanableSequence; +%typemap(doctype) eprosima::fastdds::dds::LoanableSequence "SampleInfoSeq"; %extend eprosima::fastdds::dds::LoanableSequence { size_t __len__() const @@ -88,7 +91,7 @@ if (nullptr != listener) { Swig::Director* director = SWIG_DIRECTOR_CAST(listener); - + if (nullptr != director) { Py_INCREF(director->swig_get_self()); @@ -97,7 +100,7 @@ if (nullptr != old_listener) { Swig::Director* director = SWIG_DIRECTOR_CAST(old_listener); - + if (nullptr != director) { Py_DECREF(director->swig_get_self()); diff --git a/fastdds_python/src/swig/fastdds/rtps/common/InstanceHandle.i b/fastdds_python/src/swig/fastdds/rtps/common/InstanceHandle.i index 97a0580c..5ea7b280 100644 --- a/fastdds_python/src/swig/fastdds/rtps/common/InstanceHandle.i +++ b/fastdds_python/src/swig/fastdds/rtps/common/InstanceHandle.i @@ -77,6 +77,7 @@ long hash(const eprosima::fastrtps::rtps::InstanceHandle_t& handle) // Template for std::vector %template(InstanceHandleVector) std::vector; +%typemap(doctype) std::vector"InstanceHandleVector"; %include "fastdds/rtps/common/InstanceHandle.h" From 16fd4936e8e8e4ca8dd192c276de00aff0d14ebe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Poderoso?= <120394830+JesusPoderoso@users.noreply.github.com> Date: Thu, 11 Jul 2024 16:09:59 +0200 Subject: [PATCH 07/17] Improve CI workflows in 1.4.x, and branching model refactor (#149) (#150) * Refs #21228: Refactor Ubuntu CI Signed-off-by: JesusPoderoso * Refs #21228: Refactor Windows CI Signed-off-by: JesusPoderoso * Refs #21228: Remove previous workflow Signed-off-by: JesusPoderoso * Refs #21228: Add RELEASE_SUPPORT.md with Fast DDS references Signed-off-by: JesusPoderoso * Refs #21228: Fix windows CI removing win2017 Signed-off-by: JesusPoderoso * Refs #21228: Apply rev suggestions in main PR Signed-off-by: JesusPoderoso * Refs #21228: Avoid building dependencies again Signed-off-by: JesusPoderoso * Refs #21228: Apply rev suggestions Signed-off-by: JesusPoderoso * Refs #21228: Apply rev suggestions Signed-off-by: JesusPoderoso --------- Signed-off-by: JesusPoderoso --- .../fetch-fastdds_python-repos/action.yml | 23 -- .github/workflows/build_and_test.yml | 230 --------------- .github/workflows/config/build.meta | 5 + .github/workflows/config/ubuntu_test.meta | 10 + .github/workflows/config/windows_test.meta | 9 + .github/workflows/reusable-ubuntu-ci.yml | 226 ++++++++++++++ .github/workflows/reusable-windows-ci.yml | 276 ++++++++++++++++++ .github/workflows/test.meta | 17 -- .github/workflows/ubuntu-ci.yml | 75 +++++ .github/workflows/windows-ci.yml | 79 +++++ README.md | 2 + RELEASE_SUPPORT.md | 3 + fastdds_python.repos | 2 +- 13 files changed, 686 insertions(+), 271 deletions(-) delete mode 100644 .github/actions/fetch-fastdds_python-repos/action.yml delete mode 100644 .github/workflows/build_and_test.yml create mode 100644 .github/workflows/config/build.meta create mode 100644 .github/workflows/config/ubuntu_test.meta create mode 100644 .github/workflows/config/windows_test.meta create mode 100644 .github/workflows/reusable-ubuntu-ci.yml create mode 100644 .github/workflows/reusable-windows-ci.yml delete mode 100644 .github/workflows/test.meta create mode 100644 .github/workflows/ubuntu-ci.yml create mode 100644 .github/workflows/windows-ci.yml create mode 100644 RELEASE_SUPPORT.md diff --git a/.github/actions/fetch-fastdds_python-repos/action.yml b/.github/actions/fetch-fastdds_python-repos/action.yml deleted file mode 100644 index 145def23..00000000 --- a/.github/actions/fetch-fastdds_python-repos/action.yml +++ /dev/null @@ -1,23 +0,0 @@ -name: 'fetch-fastdds_python-repos' -description: 'Fetch Fast DDS Python dependencies' -inputs: - foonathan-memory-vendor-branch: - description: 'foonathan_memory_vendor branch to be used' - required: true - fastcdr-branch: - description: 'Fast-CDR branch to be used' - required: true - fastdds-branch: - description: 'Fast-DDS branch to be used' - required: true -runs: - using: "composite" - steps: - - id: fetch-fastdds_python-repos - shell: bash - run: | - cd src - git clone https://github.com/eProsima/foonathan_memory_vendor.git --branch ${{ inputs.foonathan-memory-vendor-branch }} - git clone https://github.com/eProsima/Fast-CDR.git --branch ${{ inputs.fastcdr-branch }} - git clone https://github.com/eProsima/Fast-DDS.git --branch ${{ inputs.fastdds-branch }} - cd .. diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml deleted file mode 100644 index 14537e5d..00000000 --- a/.github/workflows/build_and_test.yml +++ /dev/null @@ -1,230 +0,0 @@ -name: test - -on: - workflow_dispatch: - inputs: - foonathan_memory_vendor_branch: - description: 'foonathan_memory_vendor branch to be used' - required: false - default: 'master' - fastcdr_versions: - description: 'Fast CDR branches to be used' - required: false - default: '["1.1.x", "master"]' - fastdds_branch: - description: 'Fast DDS branch to be used' - required: false - default: '2.14.x' - pull_request: - push: - branches: - - 1.4.x - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -jobs: - windows-build-test: - runs-on: windows-2019 - strategy: - fail-fast: false - matrix: - foonathan_memory_vendor_version: - - ${{ github.event.inputs.foonathan_memory_vendor_branch || 'master' }} - fastcdr_version: ${{ fromJson(github.event.inputs.fastcdr_versions || '["1.1.x", "master"]') }} - fastdds_version: - - ${{ github.event.inputs.fastdds_branch || '2.14.x' }} - - env: - CXXFLAGS: /MP - OPENSSL64_ROOT: "C:/Program Files/OpenSSL-Win64" - - steps: - - - uses: eProsima/eprosima-CI/windows/install_openssl@v0 - with: - version: '3.1.1' - - - name: Install Asio and TinyXML2 - shell: pwsh - run: | - mkdir "$pwdpath/choco_packages" - Invoke-WebRequest -Uri https://github.com/ros2/choco-packages/releases/download/2020-02-24/asio.1.12.1.nupkg -OutFile "$pwdpath/choco_packages/asio.1.12.1.nupkg" - Invoke-WebRequest -Uri https://github.com/ros2/choco-packages/releases/download/2020-02-24/tinyxml2.6.0.0.nupkg -OutFile "$pwdpath/choco_packages/tinyxml2.6.0.0.nupkg" - choco install -y -s "$pwdpath/choco_packages" asio tinyxml2 - Set-Item -Force -Path "env:PATH" -Value "C:\ProgramData\chocolatey\lib\asio;C:\ProgramData\chocolatey\lib\tinyxml2;C:\ProgramData\chocolatey\lib\tinyxml2\lib;$env:PATH" - echo "PATH=$env:PATH" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append - - - name: Install swig - shell: pwsh - run: choco install swig --allow-downgrade --version=4.0.2.04082020 - - - name: Setup Python version - uses: eProsima/eProsima-CI/external/setup-python@v0 - with: - python-version: '3.11' - - - name: Install Python dependencies - uses: eProsima/eProsima-CI/multiplatform/install_python_packages@v0 - with: - packages: pytest pywin32 - - - name: Install colcon - uses: eProsima/eProsima-CI/multiplatform/install_colcon@v0 - - - name: Checkout Fast DDS Python - uses: eProsima/eProsima-CI/external/checkout@v0 - with: - path: src/fastdds_python - - - name: Checkout foonathan memory vendor - uses: eProsima/eProsima-CI/external/checkout@v0 - with: - repository: eProsima/foonathan_memory_vendor - path: src/foonathan_memory_vendor - ref: ${{ matrix.foonathan_memory_vendor_version }} - - - name: Checkout Fast CDR - uses: eProsima/eProsima-CI/external/checkout@v0 - with: - repository: eProsima/Fast-CDR - path: src/fastcdr - ref: ${{ matrix.fastcdr_version }} - - - name: Checkout Fast DDS - uses: eProsima/eProsima-CI/external/checkout@v0 - with: - repository: eProsima/Fast-DDS - path: src/fastdds - ref: ${{ matrix.fastdds_version }} - - - name: Setup CMake version - uses: eProsima/eProsima-CI/external/get-cmake@v0 - with: - cmakeVersion: 3.22.6 - - - name: Setting ninja - id: ninja - if: github.event.schedule == '' - shell: pwsh - run: | - echo "cmake_generator=ninja" >> $Env:GITHUB_OUTPUT - - - name: Setup ccache - uses: eProsima/eProsima-CI/external/setup-ccache-action@v0 - with: - windows_compile_environment: msvc - api_token: ${{ secrets.GITHUB_TOKEN }} - - - name: Build workspace - uses: eProsima/eProsima-CI/windows/colcon_build@v0 - with: - colcon_meta_file: ./src/fastdds_python/.github/workflows/test.meta - colcon_build_args: --executor parallel --mixin ccache ${{ steps.ninja.outputs.cmake_generator }} - colcon_build_args_default: --event-handlers console_direct+ desktop_notification- - cmake_build_type: RelWithDebInfo - cmake_args_default: ' ' - workspace: ${{ github.workspace }} - - - name: Run tests - id: test - uses: eProsima/eProsima-CI/multiplatform/colcon_test@v0 - with: - colcon_test_args: --return-code-on-test-failure - colcon_test_args_default: --event-handlers console_direct+ desktop_notification- - ctest_args_default: --timeout 60 - packages_names: fastdds_python - workspace: ${{ github.workspace }} - workspace_dependencies: ${{ github.workspace }} - - - name: Upload Logs - uses: actions/upload-artifact@v1 - with: - name: colcon-logs-windows - path: log/ - if: always() - - ubuntu-build-test: - runs-on: ubuntu-22.04 - strategy: - fail-fast: false - matrix: - foonathan_memory_vendor_version: - - ${{ github.event.inputs.foonathan_memory_vendor_branch || 'master' }} - fastcdr_version: ${{ fromJson(github.event.inputs.fastcdr_versions || '["1.1.x", "master"]') }} - fastdds_version: - - ${{ github.event.inputs.fastdds_branch || '2.14.x' }} - - - steps: - - name: Checkout Fast DDS Python - uses: eProsima/eProsima-CI/external/checkout@v0 - with: - path: src/fastdds_python - - - name: Install apt dependencies - uses: eProsima/eProsima-CI/ubuntu/install_apt_packages@v0 - with: - packages: libasio-dev libtinyxml2-dev libpython3-dev swig - - - name: Install colcon - uses: eProsima/eProsima-CI/multiplatform/install_colcon@v0 - - - name: Checkout foonathan memory vendor - uses: eProsima/eProsima-CI/external/checkout@v0 - with: - repository: eProsima/foonathan_memory_vendor - path: src/foonathan_memory_vendor - ref: ${{ matrix.foonathan_memory_vendor_version }} - - - name: Checkout Fast CDR - uses: eProsima/eProsima-CI/external/checkout@v0 - with: - repository: eProsima/Fast-CDR - path: src/fastcdr - ref: ${{ matrix.fastcdr_version }} - - - name: Checkout Fast DDS - uses: eProsima/eProsima-CI/external/checkout@v0 - with: - repository: eProsima/Fast-DDS - path: src/fastdds - ref: ${{ matrix.fastdds_version }} - - - name: Setup CMake version - uses: eProsima/eProsima-CI/external/get-cmake@v0 - with: - cmakeVersion: 3.22.6 - - - name: Setup ccache - uses: eProsima/eProsima-CI/external/setup-ccache-action@v0 - with: - api_token: ${{ secrets.GITHUB_TOKEN }} - - - name: Build workspace - uses: eProsima/eProsima-CI/multiplatform/colcon_build@v0 - with: - colcon_meta_file: ./src/fastdds_python/.github/workflows/test.meta - colcon_build_args: --executor parallel --mixin ccache - colcon_build_args_default: --event-handlers console_direct+ - cmake_build_type: RelWithDebInfo - cmake_args_default: '' - workspace: ${{ github.workspace }} - - - name: Run tests - id: test - uses: eProsima/eProsima-CI/multiplatform/colcon_test@v0 - with: - colcon_test_args: --return-code-on-test-failure - colcon_test_args_default: --event-handlers console_direct+ - ctest_args_default: --timeout 60 - packages_names: fastdds_python - workspace: ${{ github.workspace }} - - - name: Upload Logs - uses: actions/upload-artifact@v1 - with: - name: colcon-logs-ubuntu - path: log/ - if: always() diff --git a/.github/workflows/config/build.meta b/.github/workflows/config/build.meta new file mode 100644 index 00000000..20de57d7 --- /dev/null +++ b/.github/workflows/config/build.meta @@ -0,0 +1,5 @@ +names: + fastdds: + cmake-args: + - "-DSECURITY=ON" + - "-DLOG_CONSUMER_DEFAULT=STDOUT" diff --git a/.github/workflows/config/ubuntu_test.meta b/.github/workflows/config/ubuntu_test.meta new file mode 100644 index 00000000..a96a78ea --- /dev/null +++ b/.github/workflows/config/ubuntu_test.meta @@ -0,0 +1,10 @@ +names: + fastdds_python: + cmake-args: + - "-DBUILD_TESTING=ON" + - "-DBUILD_DOCUMENTATION=ON" + ctest-args: [ + "--repeat", "until-pass:3", + "--timeout", "300", + "--label-exclude", "xfail" + ] diff --git a/.github/workflows/config/windows_test.meta b/.github/workflows/config/windows_test.meta new file mode 100644 index 00000000..bb759e45 --- /dev/null +++ b/.github/workflows/config/windows_test.meta @@ -0,0 +1,9 @@ +names: + fastdds_python: + cmake-args: + - "-DBUILD_TESTING=ON" + ctest-args: [ + "--repeat", "until-pass:3", + "--timeout", "300", + "--label-exclude", "xfail" + ] diff --git a/.github/workflows/reusable-ubuntu-ci.yml b/.github/workflows/reusable-ubuntu-ci.yml new file mode 100644 index 00000000..31779496 --- /dev/null +++ b/.github/workflows/reusable-ubuntu-ci.yml @@ -0,0 +1,226 @@ +name: Fast DDS Python Ubuntu CI reusable workflow + +on: + workflow_call: + inputs: + os-version: + description: 'The OS image for the workflow' + required: false + default: 'ubuntu-22.04' + type: string + label: + description: 'ID associated to the workflow' + required: true + type: string + colcon-args: + description: 'Extra arguments for colcon cli' + required: false + type: string + cmake-args: + description: 'Extra arguments for cmake cli' + required: false + type: string + ctest-args: + description: 'Extra arguments for ctest cli' + required: false + type: string + fastdds-python-branch: + description: 'Branch or tag of Fast DDS Python repository' + required: true + type: string + fastdds-branch: + description: 'Branch or tag of Fast DDS repository' + required: true + type: string + run-build: + description: 'Build Fast DDS Python (CI skipped otherwise)' + required: false + type: boolean + default: true + run-tests: + description: 'Run test suite of Fast DDS python' + required: false + type: boolean + default: true + use-ccache: + description: 'Use CCache to speed up the build' + required: false + type: boolean + default: false + +defaults: + run: + shell: bash + +jobs: + fastdds_python_build: + runs-on: ${{ inputs.os-version }} + if: ${{ inputs.run-build == true }} + strategy: + fail-fast: false + matrix: + cmake-build-type: + - 'RelWithDebInfo' + steps: + - name: Add ci-pending label if PR + if: ${{ github.event_name == 'pull_request' }} + uses: eProsima/eProsima-CI/external/add_labels@v0 + with: + labels: ci-pending + number: ${{ github.event.number }} + repo: eProsima/Fast-DDS-Python + + - name: Sync eProsima/Fast-DDS-Python repository + uses: eProsima/eProsima-CI/external/checkout@v0 + with: + path: src/fastdds_python + ref: ${{ inputs.fastdds-python-branch }} + + - name: Install Fix Python version + uses: eProsima/eProsima-CI/external/setup-python@v0 + with: + python-version: '3.11' + + - name: Get minimum supported version of CMake + uses: eProsima/eProsima-CI/external/get-cmake@v0 + with: + cmakeVersion: '3.22.6' + + - name: Install apt dependencies + uses: eProsima/eProsima-CI/ubuntu/install_apt_packages@v0 + with: + packages: libasio-dev libtinyxml2-dev libssl-dev swig doxygen + update: false + upgrade: false + + - name: Install colcon + uses: eProsima/eProsima-CI/ubuntu/install_colcon@v0 + + - name: Install Python dependencies + uses: eProsima/eProsima-CI/multiplatform/install_python_packages@v0 + with: + packages: vcstool xmlschema + upgrade: false + + - name: Setup CCache + uses: eProsima/eProsima-CI/external/setup-ccache-action@v0 + if: ${{ inputs.use-ccache == true }} + with: + api_token: ${{ secrets.GITHUB_TOKEN }} + + - name: Get Fast DDS branch + id: get_fastdds_branch + uses: eProsima/eProsima-CI/ubuntu/get_related_branch_from_repo@v0 + with: + remote_repository: eProsima/Fast-DDS + fallback_branch: ${{ inputs.fastdds-branch }} + + - name: Download Fast DDS repo + uses: eProsima/eProsima-CI/external/checkout@v0 + with: + repository: eProsima/Fast-DDS + path: src/fastdds + ref: ${{ steps.get_fastdds_branch.outputs.deduced_branch }} + + - name: Fetch Fast DDS Python dependencies + uses: eProsima/eProsima-CI/multiplatform/vcs_import@v0 + with: + vcs_repos_file: ${{ github.workspace }}/src/fastdds_python/fastdds_python.repos + destination_workspace: src + skip_existing: 'true' + + - name: Colcon build + continue-on-error: false + uses: eProsima/eProsima-CI/multiplatform/colcon_build@v0 + with: + colcon_meta_file: ${{ github.workspace }}/src/fastdds_python/.github/workflows/config/build.meta + colcon_build_args: ${{ inputs.colcon-args }} + cmake_args: ${{ inputs.cmake-args }} + cmake_build_type: ${{ matrix.cmake-build-type }} + workspace: ${{ github.workspace }} + + - name: Upload build artifacts + uses: eProsima/eProsima-CI/external/upload-artifact@v0 + with: + name: fastdds_python_build_${{ inputs.label }} + path: ${{ github.workspace }} + + fastdds_python_test: + needs: fastdds_python_build + runs-on: ${{ inputs.os-version }} + if: ${{ inputs.run-tests == true }} + strategy: + fail-fast: false + matrix: + cmake-build-type: + - 'RelWithDebInfo' + steps: + - name: Download python build artifacts + uses: eProsima/eProsima-CI/external/download-artifact@v0 + with: + name: fastdds_python_build_${{ inputs.label }} + path: ${{ github.workspace }} + + - name: Install Fix Python version + uses: eProsima/eProsima-CI/external/setup-python@v0 + with: + python-version: '3.11' + + - name: Get minimum supported version of CMake + uses: eProsima/eProsima-CI/external/get-cmake@v0 + with: + cmakeVersion: '3.22.6' + + - name: Install apt packages + uses: eProsima/eProsima-CI/ubuntu/install_apt_packages@v0 + with: + packages: libasio-dev libtinyxml2-dev libssl-dev swig + + - name: Install colcon + uses: eProsima/eProsima-CI/ubuntu/install_colcon@v0 + + - name: Install Python dependencies + uses: eProsima/eProsima-CI/ubuntu/install_python_packages@v0 + with: + packages: xmlschema pytest + + - name: Setup CCache + uses: eProsima/eProsima-CI/external/setup-ccache-action@v0 + if: ${{ inputs.use-ccache == true }} + with: + api_token: ${{ secrets.GITHUB_TOKEN }} + + - name: Colcon build + continue-on-error: false + uses: eProsima/eProsima-CI/multiplatform/colcon_build@v0 + with: + colcon_meta_file: ${{ github.workspace }}/src/fastdds_python/.github/workflows/config/build.meta ${{ github.workspace }}/src/fastdds_python/.github/workflows/config/ubuntu_test.meta + colcon_build_args: ${{ inputs.colcon-args }} + colcon_build_args_default: '--packages-select fastdds_python' + cmake_args: ${{ inputs.cmake-args }} + cmake_build_type: ${{ matrix.cmake-build-type }} + workspace: ${{ github.workspace }} + workspace_dependencies: ${{ github.workspace }}/install + + - name: Colcon test + id: python_test + uses: eProsima/eProsima-CI/multiplatform/colcon_test@v0 + with: + colcon_meta_file: ${{ github.workspace }}/src/fastdds_python/.github/workflows/config/ubuntu_test.meta + colcon_test_args: ${{ inputs.colcon-args }} + colcon_test_args_default: --event-handlers=console_direct+ + ctest_args: ${{ inputs.ctest-args }} + packages_names: fastdds_python + workspace: ${{ github.workspace }} + workspace_dependencies: '' + test_report_artifact: ${{ format('test_report_{0}_{1}_{2}', inputs.label, github.job, join(matrix.*, '_')) }} + + - name: Fast DDS Python test summary + uses: eProsima/eProsima-CI/multiplatform/junit_summary@v0 + if: ${{ !cancelled() }} + with: + junit_reports_dir: "${{ steps.python_test.outputs.ctest_results_path }}" + print_summary: 'True' + show_failed: 'True' + show_disabled: 'False' + show_skipped: 'False' diff --git a/.github/workflows/reusable-windows-ci.yml b/.github/workflows/reusable-windows-ci.yml new file mode 100644 index 00000000..ecdb26af --- /dev/null +++ b/.github/workflows/reusable-windows-ci.yml @@ -0,0 +1,276 @@ +name: Fast DDS Python Windows CI reusable workflow + +on: + workflow_call: + inputs: + os-version: + description: 'The OS image for the workflow' + required: false + default: 'windows-2019' + type: string + vs-toolset: + description: 'The VS toolset to use for the build' + required: false + default: 'v142' + type: string + label: + description: 'ID associated to the workflow' + required: true + type: string + colcon-args: + description: 'Extra arguments for colcon cli' + required: false + type: string + cmake-args: + description: 'Extra arguments for cmake cli' + required: false + type: string + ctest-args: + description: 'Extra arguments for ctest cli' + required: false + type: string + fastdds-python-branch: + description: 'Branch or tag of Fast DDS Python repository' + required: true + type: string + fastdds-branch: + description: 'Branch or tag of Fast DDS repository' + required: true + type: string + run-build: + description: 'Build Fast DDS Python (CI skipped otherwise)' + required: false + type: boolean + default: true + run-tests: + description: 'Run test suite of Fast DDS python' + required: false + type: boolean + default: true +env: + colcon-build-default-cmake-args: '-DTHIRDPARTY_Asio=FORCE -DTHIRDPARTY_TinyXML2=FORCE -DTHIRDPARTY_fastcdr=OFF -DTHIRDPARTY_UPDATE=ON -DEPROSIMA_EXTRA_CMAKE_CXX_FLAGS="/MP /WX"' +defaults: + run: + shell: pwsh + +jobs: + fastdds_python_build: + runs-on: ${{ inputs.os-version }} + if: ${{ inputs.run-build == true }} + strategy: + fail-fast: false + matrix: + cmake-build-type: + - 'RelWithDebInfo' + + steps: + - name: Add ci-pending label if PR + if: ${{ github.event_name == 'pull_request' }} + uses: eProsima/eProsima-CI/external/add_labels@v0 + with: + labels: ci-pending + number: ${{ github.event.number }} + repo: eProsima/Fast-DDS-Python + + - name: Sync eProsima/Fast-DDS-Python repository + uses: eProsima/eProsima-CI/external/checkout@v0 + with: + path: src/fastdds_python + ref: ${{ inputs.fastdds-python-branch }} + + - name: Install Fix Python version + uses: eProsima/eProsima-CI/external/setup-python@v0 + with: + python-version: '3.11' + + - name: Get minimum supported version of CMake + uses: eProsima/eProsima-CI/external/get-cmake@v0 + with: + cmakeVersion: '3.22.6' + + - name: Install OpenSSL + uses: eProsima/eprosima-CI/windows/install_openssl@v0 + with: + version: '3.1.1' + + - name: Update OpenSSL environment variables + run: | + # Update the environment + if (Test-Path -Path $Env:ProgramW6432\OpenSSL) + { + "OPENSSL64_ROOT=$Env:ProgramW6432\OpenSSL" | Out-File $Env:GITHUB_ENV -Append -Encoding OEM + } + elseif (Test-Path -Path $Env:ProgramW6432\OpenSSL-Win) + { + "OPENSSL64_ROOT=$Env:ProgramW6432\OpenSSL-Win" | Out-File $Env:GITHUB_ENV -Append -Encoding OEM + } + elseif (Test-Path -Path $Env:ProgramW6432\OpenSSL-Win64) + { + "OPENSSL64_ROOT=$Env:ProgramW6432\OpenSSL-Win64" | Out-File $Env:GITHUB_ENV -Append -Encoding OEM + } + else + { + Write-Error -Message "Cannot find OpenSSL installation." + exit 1 + } + + - name: Install colcon + uses: eProsima/eProsima-CI/windows/install_colcon@v0 + + - name: Install Python dependencies + uses: eProsima/eProsima-CI/windows/install_python_packages@v0 + with: + packages: vcstool xmlschema pywin32 + + - name: Install swig + shell: pwsh + run: choco install swig --allow-downgrade --version=4.0.2.04082020 + + - name: Get Fast DDS branch + id: get_fastdds_branch + uses: eProsima/eProsima-CI/multiplatform/get_related_branch_from_repo@v0 + with: + remote_repository: eProsima/Fast-DDS + fallback_branch: ${{ inputs.fastdds-branch }} + + - name: Download Fast DDS repo + uses: eProsima/eProsima-CI/external/checkout@v0 + with: + repository: eProsima/Fast-DDS + path: src/fastdds + ref: ${{ steps.get_fastdds_branch.outputs.deduced_branch }} + + - name: Fetch Fast DDS Python dependencies + uses: eProsima/eProsima-CI/multiplatform/vcs_import@v0 + with: + vcs_repos_file: ${{ github.workspace }}/src/fastdds_python/fastdds_python.repos + destination_workspace: src + skip_existing: 'true' + + - name: Colcon build + continue-on-error: false + uses: eProsima/eProsima-CI/multiplatform/colcon_build@v0 + with: + colcon_meta_file: ${{ github.workspace }}/src/fastdds_python/.github/workflows/config/build.meta + colcon_build_args: ${{ inputs.colcon-args }} + colcon_build_args_default: --event-handlers console_direct+ + cmake_args: ${{ inputs.cmake-args }} + cmake_args_default: '-T ${{ inputs.vs-toolset }} ${{ env.colcon-build-default-cmake-args }}' + cmake_build_type: ${{ matrix.cmake-build-type }} + workspace: ${{ github.workspace }} + + - name: Upload build artifacts + uses: eProsima/eProsima-CI/external/upload-artifact@v0 + with: + name: fastdds_python_build_${{ inputs.label }} + path: ${{ github.workspace }} + + + fastdds_python_test: + needs: fastdds_python_build + runs-on: ${{ inputs.os-version }} + if: ${{ inputs.run-tests == true }} + strategy: + fail-fast: false + matrix: + cmake-build-type: + - 'RelWithDebInfo' + steps: + - name: Download python build artifacts + uses: eProsima/eProsima-CI/external/download-artifact@v0 + with: + name: fastdds_python_build_${{ inputs.label }} + path: ${{ github.workspace }} + + - name: Install Fix Python version + uses: eProsima/eProsima-CI/external/setup-python@v0 + with: + python-version: '3.11' + + - name: Get minimum supported version of CMake + uses: eProsima/eProsima-CI/external/get-cmake@v0 + with: + cmakeVersion: '3.22.6' + + - name: Install OpenSSL + uses: eProsima/eprosima-CI/windows/install_openssl@v0 + with: + version: '3.1.1' + + - name: Update OpenSSL environment variables + run: | + # Update the environment + if (Test-Path -Path $Env:ProgramW6432\OpenSSL) + { + "OPENSSL64_ROOT=$Env:ProgramW6432\OpenSSL" | Out-File $Env:GITHUB_ENV -Append -Encoding OEM + } + elseif (Test-Path -Path $Env:ProgramW6432\OpenSSL-Win) + { + "OPENSSL64_ROOT=$Env:ProgramW6432\OpenSSL-Win" | Out-File $Env:GITHUB_ENV -Append -Encoding OEM + } + elseif (Test-Path -Path $Env:ProgramW6432\OpenSSL-Win64) + { + "OPENSSL64_ROOT=$Env:ProgramW6432\OpenSSL-Win64" | Out-File $Env:GITHUB_ENV -Append -Encoding OEM + } + else + { + Write-Error -Message "Cannot find OpenSSL installation." + exit 1 + } + + - name: Install colcon + uses: eProsima/eProsima-CI/windows/install_colcon@v0 + + - name: Install Python dependencies + uses: eProsima/eProsima-CI/windows/install_python_packages@v0 + with: + packages: vcstool xmlschema pywin32 pytest + + - name: Install swig + shell: pwsh + run: choco install swig --allow-downgrade --version=4.0.2.04082020 + + - name: Install doxygen + uses: eProsima/eProsima-CI/external/install_doxygen@v0 + + - name: Prepare build meta file + uses: eProsima/eProsima-CI/windows/merge_yaml_metas@v0 + with: + metas: "@('${{ github.workspace }}/src/fastdds_python/.github/workflows/config/build.meta', '${{ github.workspace }}/src/fastdds_python/.github/workflows/config/windows_test.meta')" + path: '${{ github.workspace }}/src/fastdds_python/.github/workflows/config/build_test.meta' + + - name: Colcon build + continue-on-error: false + uses: eProsima/eProsima-CI/multiplatform/colcon_build@v0 + with: + colcon_meta_file: ${{ github.workspace }}/src/fastdds_python/.github/workflows/config/build_test.meta + colcon_build_args: ${{ inputs.colcon-args }} + colcon_build_args_default: '--event-handlers console_direct+ --packages-select fastdds_python' + cmake_args: ${{ inputs.cmake-args }} + cmake_args_default: '-T ${{ inputs.vs-toolset }} ${{ env.colcon-build-default-cmake-args }}' + cmake_build_type: ${{ matrix.cmake-build-type }} + workspace: ${{ github.workspace }} + workspace_dependencies: ${{ github.workspace }}/install + + - name: Colcon test + id: python_test + uses: eProsima/eProsima-CI/multiplatform/colcon_test@v0 + with: + colcon_meta_file: ${{ github.workspace }}/src/fastdds_python/.github/workflows/config/windows_test.meta + colcon_test_args: ${{ inputs.colcon-args }} + colcon_test_args_default: --event-handlers=console_direct+ + ctest_args: ${{ inputs.ctest-args }} + packages_names: fastdds_python + workspace: ${{ github.workspace }} + workspace_dependencies: '' + test_report_artifact: ${{ format('test_report_{0}_{1}_{2}', inputs.label, github.job, join(matrix.*, '_')) }} + + - name: Test summary + uses: eProsima/eProsima-CI/multiplatform/junit_summary@v0 + if: ${{ !cancelled() }} + with: + junit_reports_dir: "${{ steps.python_test.outputs.ctest_results_path }}" + print_summary: 'True' + show_failed: 'True' + show_disabled: 'False' + show_skipped: 'False' diff --git a/.github/workflows/test.meta b/.github/workflows/test.meta deleted file mode 100644 index 1271f248..00000000 --- a/.github/workflows/test.meta +++ /dev/null @@ -1,17 +0,0 @@ -{ - "names": - { - "fastrtps": - { - "cmake-args": [ - "-DSECURITY=ON" - ] - }, - "fastdds_python": - { - "cmake-args": [ - "-DBUILD_TESTING=ON" - ] - } - } -} diff --git a/.github/workflows/ubuntu-ci.yml b/.github/workflows/ubuntu-ci.yml new file mode 100644 index 00000000..fff4cee9 --- /dev/null +++ b/.github/workflows/ubuntu-ci.yml @@ -0,0 +1,75 @@ +name: Fast DDS Python Ubuntu CI + +on: + workflow_dispatch: + inputs: + os-version: + description: 'OS version to run the workflow' + required: false + default: 'ubuntu-22.04' + type: string + colcon-args: + description: 'Extra arguments for colcon cli' + required: false + type: string + cmake-args: + description: 'Extra arguments for cmake cli' + required: false + type: string + ctest-args: + description: 'Extra arguments for ctest cli' + required: false + type: string + fastdds-python-branch: + description: 'Branch or tag of Fast DDS Python repository' + required: true + type: string + fastdds-branch: + description: 'Branch or tag of Fast DDS repository' + type: string + required: true + run-tests: + description: 'Run test suite of Fast DDS python' + required: false + type: boolean + default: true + use-ccache: + description: 'Use CCache to speed up the build' + required: false + type: boolean + default: false + pull_request: + types: + - review_requested + paths-ignore: + - '**.md' + - '**.txt' + - '!**/CMakeLists.txt' + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +jobs: + ubuntu-ci: + strategy: + fail-fast: false + matrix: + fastdds-branch: + - '2.14.x' + - '2.13.x' + if: ${{ !(github.event_name == 'pull_request') || !contains(github.event.pull_request.labels.*.name, 'conflicts') }} + uses: ./.github/workflows/reusable-ubuntu-ci.yml + with: + # It would be desirable to have a matrix of ubuntu OS for this job, but due to the issue opened in this ticket: + # https://github.com/orgs/community/discussions/128118 , it has been set as a single OS job. + os-version: ${{ inputs.os-version || 'ubuntu-22.04' }} + label: 'ubuntu-ci-1.4.x-${{ matrix.fastdds-branch }}' + colcon-args: ${{ inputs.colcon-args }} + cmake-args: ${{ inputs.cmake-args }} + ctest-args: ${{ inputs.ctest-args }} + fastdds-python-branch: ${{ inputs.fastdds-python-branch || github.ref }} + fastdds-branch: ${{ inputs.fastdds-branch || matrix.fastdds-branch }} + run-build: ${{ !(github.event_name == 'pull_request') || !contains(github.event.pull_request.labels.*.name, 'skip-ci') }} + run-tests: ${{ (inputs.run-tests == true) || ((github.event_name == 'pull_request') && (!contains(github.event.pull_request.labels.*.name, 'no-test'))) }} + use-ccache: ${{ inputs.use-ccache || false }} diff --git a/.github/workflows/windows-ci.yml b/.github/workflows/windows-ci.yml new file mode 100644 index 00000000..bf2cb3ad --- /dev/null +++ b/.github/workflows/windows-ci.yml @@ -0,0 +1,79 @@ +name: Fast DDS Python Windows CI + +on: + workflow_dispatch: + inputs: + os-version: + description: 'OS version to run the workflow' + required: false + default: 'windows-2019' + type: string + vs-toolset: + description: 'The VS toolset to use for the build' + required: false + default: 'v142' + type: string + colcon-args: + description: 'Extra arguments for colcon cli' + required: false + type: string + cmake-args: + description: 'Extra arguments for cmake cli' + required: false + type: string + ctest-args: + description: 'Extra arguments for ctest cli' + required: false + type: string + fastdds-python-branch: + description: 'Branch or tag of Fast DDS Python repository' + required: true + type: string + fastdds-branch: + description: 'Branch or tag of Fast DDS repository' + type: string + required: true + run-tests: + description: 'Run test suite of Fast DDS python' + required: false + type: boolean + default: true + + pull_request: + types: + - review_requested + paths-ignore: + - '**.md' + - '**.txt' + - '!**/CMakeLists.txt' + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +jobs: + windows-ci: + strategy: + fail-fast: false + matrix: + vs-toolset: + - 'v141' + - 'v142' + fastdds-branch: + - '2.14.x' + - '2.13.x' + if: ${{ !(github.event_name == 'pull_request') || !contains(github.event.pull_request.labels.*.name, 'conflicts') }} + uses: ./.github/workflows/reusable-windows-ci.yml + with: + # It would be desirable to have a matrix of windows OS for this job, but due to the issue opened in this ticket: + # https://github.com/orgs/community/discussions/128118 , it has been set as a single OS job. + os-version: ${{ inputs.os-version || 'windows-2019' }} + vs-toolset: ${{ inputs.vs-toolset || matrix.vs-toolset }} + label: 'windows-${{ matrix.vs-toolset }}-ci-1.4.x-${{ matrix.fastdds-branch }}' + colcon-args: ${{ inputs.colcon-args }} + cmake-args: ${{ inputs.cmake-args }} + ctest-args: ${{ inputs.ctest-args }} + fastdds-python-branch: ${{ inputs.fastdds-python-branch || github.ref }} + fastdds-branch: ${{ inputs.fastdds-branch || matrix.fastdds-branch }} + run-build: ${{ !(github.event_name == 'pull_request') || !contains(github.event.pull_request.labels.*.name, 'skip-ci') }} + run-tests: ${{ (inputs.run-tests == true) || ((github.event_name == 'pull_request') && (!contains(github.event.pull_request.labels.*.name, 'no-test'))) }} diff --git a/README.md b/README.md index 4cf06f71..4746f5ca 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,8 @@ [![Issues](https://img.shields.io/github/issues/eProsima/Fast-DDS-python.svg)](https://github.com/eProsima/Fast-DDS-python/issues) [![Forks](https://img.shields.io/github/forks/eProsima/Fast-DDS-python.svg)](https://github.com/eProsima/Fast-DDS-python/network/members) [![Stars](https://img.shields.io/github/stars/eProsima/Fast-DDS-python.svg)](https://github.com/eProsima/Fast-DDS-python/stargazers) +[![Fast DDS Python Ubuntu CI (nightly)](https://github.com/eProsima/Fast-DDS-Python/actions/workflows/nightly-ubuntu-ci.yml/badge.svg)](https://github.com/eProsima/Fast-DDS-Python/actions/workflows/nightly-ubuntu-ci.yml) +[![Fast DDS Python Windows CI (nightly)](https://github.com/eProsima/Fast-DDS-Python/actions/workflows/nightly-windows-ci.yml/badge.svg)](https://github.com/eProsima/Fast-DDS-Python/actions/workflows/nightly-windows-ci.yml) *eProsima Fast DDS Python* is a Python binding for the [*eProsima Fast DDS*](https://github.com/eProsima/Fast-DDS) C++ library. diff --git a/RELEASE_SUPPORT.md b/RELEASE_SUPPORT.md new file mode 100644 index 00000000..dce79481 --- /dev/null +++ b/RELEASE_SUPPORT.md @@ -0,0 +1,3 @@ +# Release support + +Please, refer to the [main branch](https://github.com/eProsima/Fast-DDS-Python/blob/master/RELEASE_SUPPORT.md) for the latest version of this document. diff --git a/fastdds_python.repos b/fastdds_python.repos index 3d2ec276..9930015f 100644 --- a/fastdds_python.repos +++ b/fastdds_python.repos @@ -2,7 +2,7 @@ repositories: foonathan_memory_vendor: type: git url: https://github.com/eProsima/foonathan_memory_vendor.git - version: master + version: v1.3.1 fastcdr: type: git url: https://github.com/eProsima/Fast-CDR.git From 604a11ffcedff59ba9579612ae2732d971362fe3 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Thu, 18 Jul 2024 14:49:58 +0200 Subject: [PATCH 08/17] Fix warning about memory leak (#141) (#159) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (cherry picked from commit 7cbeb21dc67c416c5afcdc22df00c550b2c2cb92) Signed-off-by: Ricardo González Moreno Signed-off-by: eduponz Co-authored-by: Ricardo González --- .../fastdds/dds/core/policy/QosPolicies.i | 80 +------------- .../utils/collections/ResourceLimitedVector.i | 102 ++++++++++++++++-- .../test/api/test_domainparticipant.py | 4 +- fastdds_python/test/api/test_qos.py | 48 ++++----- 4 files changed, 119 insertions(+), 115 deletions(-) diff --git a/fastdds_python/src/swig/fastdds/dds/core/policy/QosPolicies.i b/fastdds_python/src/swig/fastdds/dds/core/policy/QosPolicies.i index 00d2f46c..77a1c13a 100644 --- a/fastdds_python/src/swig/fastdds/dds/core/policy/QosPolicies.i +++ b/fastdds_python/src/swig/fastdds/dds/core/policy/QosPolicies.i @@ -58,91 +58,13 @@ namespace dds { } } -%inline %{ -class OctetResourceLimitedVectorStopIterator {}; -class OctetResourceLimitedVectorIterator { -public: - OctetResourceLimitedVectorIterator( - eprosima::fastrtps::ResourceLimitedVector::iterator _cur, - eprosima::fastrtps::ResourceLimitedVector::iterator _end) : cur(_cur), end(_end) {} - OctetResourceLimitedVectorIterator* __iter__() - { - return this; - } - eprosima::fastrtps::ResourceLimitedVector::iterator cur; - eprosima::fastrtps::ResourceLimitedVector::iterator end; -}; -%} - // SWIG does not support templates in the generated binding, // because not all output languages support them // We must explicitly declare the specializations of the templates -%template(OctetResourceLimitedVector) eprosima::fastrtps::ResourceLimitedVector; +resource_limited_vector_template(OctetResourceLimitedVector, eprosima::fastrtps::rtps::octet) %include "fastdds/dds/core/policy/QosPolicies.hpp" -%include "exception.i" -%exception OctetResourceLimitedVectorIterator::__next__ { - try - { - $action // calls %extend function __next__() below - } - catch (OctetResourceLimitedVectorStopIterator) - { - PyErr_SetString(PyExc_StopIteration, "End of iterator"); - return nullptr; - } -} - -%extend OctetResourceLimitedVectorIterator -{ - eprosima::fastrtps::rtps::octet __next__() - { - if ($self->cur != $self->end) - { - // dereference the iterator and return reference to the object, - // after that it increments the iterator - return *$self->cur++; - } - throw OctetResourceLimitedVectorStopIterator(); - } -} - -%exception eprosima::fastrtps::ResourceLimitedVector::__getitem__ -{ - try - { - $action - } - catch(std::out_of_range) - { - SWIG_exception(SWIG_IndexError, "Index out of bounds"); - } -} - -%extend eprosima::fastrtps::ResourceLimitedVector -{ - OctetResourceLimitedVectorIterator __iter__() - { - // return a constructed Iterator object - return OctetResourceLimitedVectorIterator($self->begin(), $self->end()); - } - - size_t __len__() const - { - return self->size(); - } - - eprosima::fastrtps::rtps::octet __getitem__(int i) - { - if (self->size() <= i) - { - throw std::out_of_range("Index out of bounds"); - } - return (*self)[i]; - } -} - %exception eprosima::fastdds::dds::PartitionQosPolicy::__getitem__ { try diff --git a/fastdds_python/src/swig/fastrtps/utils/collections/ResourceLimitedVector.i b/fastdds_python/src/swig/fastrtps/utils/collections/ResourceLimitedVector.i index 2b9c48df..d4be435c 100644 --- a/fastdds_python/src/swig/fastrtps/utils/collections/ResourceLimitedVector.i +++ b/fastdds_python/src/swig/fastrtps/utils/collections/ResourceLimitedVector.i @@ -16,6 +16,8 @@ #include "fastrtps/utils/collections/ResourceLimitedVector.hpp" %} +%include "exception.i" + // Operator[] is ignored by SWIG because it does not map correctly to target languages // mostly because of its dual getter/setter nature // We can ignore them and extend to make the getter and setter methods explicit and break the overload @@ -29,6 +31,7 @@ %ignore eprosima::fastrtps::ResourceLimitedVector::at; %ignore eprosima::fastrtps::ResourceLimitedVector::front; %ignore eprosima::fastrtps::ResourceLimitedVector::back; +%ignore eprosima::fastrtps::ResourceLimitedVector::push_back; // Initializer lists are note supported in SWIG. Ignore the method %ignore eprosima::fastrtps::ResourceLimitedVector::assign(std::initializer_list); @@ -37,28 +40,107 @@ // and SWIG does not support it in any case %ignore eprosima::fastrtps::ResourceLimitedVector::operator const collection_type&; - -%extend eprosima::fastrtps::ResourceLimitedVector { - pointer at(size_type pos) +%exception eprosima::fastdds::ResourceLimitedVector::__getitem__ +{ + try + { + $action + } + catch(std::out_of_range) { - return &($self->at(pos)); + SWIG_exception(SWIG_IndexError, "Index out of bounds"); } - pointer front() +} + + +%extend eprosima::fastrtps::ResourceLimitedVector { + + size_t __len__() const { - return &($self->front()); + return self->size(); } - pointer back() + + value_type __getitem__(int i) { - return &($self->back()); + if (self->size() <= i) + { + throw std::out_of_range("Index out of bounds"); + } + return (*self)[i]; } pointer getitem(size_type n) { return &($self->operator[](n)); } - void setitem(size_type n, const_pointer v) { - $self->operator[](n) = *v; + void setitem(size_type n, value_type v) { + $self->operator[](n) = v; + } + + void append(value_type v) { + $self->push_back(v); } } %include "fastrtps/utils/collections/ResourceLimitedVector.hpp" + +%define resource_limited_vector_template(name_, value_type_) +%inline %{ + class name_ ## StopIterator {}; + class name_ ## Iterator + { + public: + name_ ## Iterator( + typename eprosima::fastrtps::ResourceLimitedVector::iterator _cur, + typename eprosima::fastrtps::ResourceLimitedVector::iterator _end) + : cur(_cur) + , end(_end) + { + } + + name_ ## Iterator* __iter__() + { + return this; + } + typename eprosima::fastrtps::ResourceLimitedVector::iterator cur; + typename eprosima::fastrtps::ResourceLimitedVector::iterator end; + }; +%} + +%exception name_ ## Iterator::__next__ { + try + { + $action // calls %extend function __next__() below + } + catch (name_ ## StopIterator) + { + PyErr_SetString(PyExc_StopIteration, "End of iterator"); + return nullptr; + } +} + +%extend name_ ## Iterator +{ + value_type_ __next__() + { + if ($self->cur != $self->end) + { + // dereference the iterator and return reference to the object, + // after that it increments the iterator + return *$self->cur++; + } + throw name_ ## StopIterator(); + } +} + +%template(name_) eprosima::fastrtps::ResourceLimitedVector; + +%extend eprosima::fastrtps::ResourceLimitedVector +{ + name_ ## Iterator __iter__() + { + // return a constructed Iterator object + return name_ ## Iterator($self->begin(), $self->end()); + } +} +%enddef diff --git a/fastdds_python/test/api/test_domainparticipant.py b/fastdds_python/test/api/test_domainparticipant.py index 1d8ea006..17f06e50 100644 --- a/fastdds_python/test/api/test_domainparticipant.py +++ b/fastdds_python/test/api/test_domainparticipant.py @@ -916,8 +916,8 @@ def test_get_set_qos(participant): """ qos = fastdds.DomainParticipantQos() assert(fastdds.ReturnCode_t.RETCODE_OK == participant.get_qos(qos)) - qos.user_data().push_back(1) - qos.user_data().push_back(2) + qos.user_data().append(1) + qos.user_data().append(2) assert(2 == len(qos.user_data())) assert(fastdds.ReturnCode_t.RETCODE_OK == diff --git a/fastdds_python/test/api/test_qos.py b/fastdds_python/test/api/test_qos.py index 02278dc8..817e3a21 100644 --- a/fastdds_python/test/api/test_qos.py +++ b/fastdds_python/test/api/test_qos.py @@ -82,10 +82,10 @@ def test_datareader_qos(): assert(2 == datareader_qos.resource_limits().extra_samples) # .user_data - datareader_qos.user_data().push_back(0) - datareader_qos.user_data().push_back(1) - datareader_qos.user_data().push_back(2) - datareader_qos.user_data().push_back(3) + datareader_qos.user_data().append(0) + datareader_qos.user_data().append(1) + datareader_qos.user_data().append(2) + datareader_qos.user_data().append(3) count = 1 for user_value in datareader_qos.user_data(): if 1 == count: @@ -560,10 +560,10 @@ def test_datawriter_qos(): assert(33 == datawriter_qos.lifespan().duration.nanosec) # .user_data - datawriter_qos.user_data().push_back(0) - datawriter_qos.user_data().push_back(1) - datawriter_qos.user_data().push_back(2) - datawriter_qos.user_data().push_back(3) + datawriter_qos.user_data().append(0) + datawriter_qos.user_data().append(1) + datawriter_qos.user_data().append(2) + datawriter_qos.user_data().append(3) count = 1 for user_value in datawriter_qos.user_data(): if 1 == count: @@ -873,10 +873,10 @@ def test_topic_qos(): topic_qos = fastdds.TopicQos() # .topic_data - topic_qos.topic_data().push_back(0) - topic_qos.topic_data().push_back(1) - topic_qos.topic_data().push_back(2) - topic_qos.topic_data().push_back(3) + topic_qos.topic_data().append(0) + topic_qos.topic_data().append(1) + topic_qos.topic_data().append(2) + topic_qos.topic_data().append(3) count = 1 for topic_value in topic_qos.topic_data(): if 1 == count: @@ -1091,10 +1091,10 @@ def test_subscriber_qos(): assert('Partition2' == subscriber_qos.partition()[1]) # .group_data - subscriber_qos.group_data().push_back(0) - subscriber_qos.group_data().push_back(1) - subscriber_qos.group_data().push_back(2) - subscriber_qos.group_data().push_back(3) + subscriber_qos.group_data().append(0) + subscriber_qos.group_data().append(1) + subscriber_qos.group_data().append(2) + subscriber_qos.group_data().append(3) count = 1 for group_value in subscriber_qos.group_data(): if 1 == count: @@ -1175,10 +1175,10 @@ def test_publisher_qos(): assert('Partition2' == publisher_qos.partition()[1]) # .group_data - publisher_qos.group_data().push_back(0) - publisher_qos.group_data().push_back(1) - publisher_qos.group_data().push_back(2) - publisher_qos.group_data().push_back(3) + publisher_qos.group_data().append(0) + publisher_qos.group_data().append(1) + publisher_qos.group_data().append(2) + publisher_qos.group_data().append(3) count = 1 for group_value in publisher_qos.group_data(): if 1 == count: @@ -1353,10 +1353,10 @@ def test_domain_participant_qos(): assert(not participant_qos.transport().use_builtin_transports) # .user_data - participant_qos.user_data().push_back(0) - participant_qos.user_data().push_back(1) - participant_qos.user_data().push_back(2) - participant_qos.user_data().push_back(3) + participant_qos.user_data().append(0) + participant_qos.user_data().append(1) + participant_qos.user_data().append(2) + participant_qos.user_data().append(3) count = 1 for user_value in participant_qos.user_data(): if 1 == count: From 375d310d128ee9e59d32a4ba671a402196e07eac Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Tue, 23 Jul 2024 11:06:58 +0200 Subject: [PATCH 09/17] Avoid usage of removed action (#171) (#172) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: JesusPoderoso (cherry picked from commit 976dcd604114198ab6b16a08845d0a746c28f704) Co-authored-by: Jesús Poderoso <120394830+JesusPoderoso@users.noreply.github.com> --- .github/workflows/reusable-windows-ci.yml | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/.github/workflows/reusable-windows-ci.yml b/.github/workflows/reusable-windows-ci.yml index ecdb26af..5b23342e 100644 --- a/.github/workflows/reusable-windows-ci.yml +++ b/.github/workflows/reusable-windows-ci.yml @@ -233,17 +233,11 @@ jobs: - name: Install doxygen uses: eProsima/eProsima-CI/external/install_doxygen@v0 - - name: Prepare build meta file - uses: eProsima/eProsima-CI/windows/merge_yaml_metas@v0 - with: - metas: "@('${{ github.workspace }}/src/fastdds_python/.github/workflows/config/build.meta', '${{ github.workspace }}/src/fastdds_python/.github/workflows/config/windows_test.meta')" - path: '${{ github.workspace }}/src/fastdds_python/.github/workflows/config/build_test.meta' - - name: Colcon build continue-on-error: false uses: eProsima/eProsima-CI/multiplatform/colcon_build@v0 with: - colcon_meta_file: ${{ github.workspace }}/src/fastdds_python/.github/workflows/config/build_test.meta + colcon_meta_file: ${{ github.workspace }}/src/fastdds_python/.github/workflows/config/build.meta ${{ github.workspace }}/src/fastdds_python/.github/workflows/config/windows_test.meta colcon_build_args: ${{ inputs.colcon-args }} colcon_build_args_default: '--event-handlers console_direct+ --packages-select fastdds_python' cmake_args: ${{ inputs.cmake-args }} From f123d9dcb6258a3a3f7a7567e0fa0815236696ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Poderoso?= <120394830+JesusPoderoso@users.noreply.github.com> Date: Tue, 23 Jul 2024 11:53:07 +0200 Subject: [PATCH 10/17] Remove 2.13.x from CI (#175) Signed-off-by: JesusPoderoso --- .github/workflows/ubuntu-ci.yml | 10 ++-------- .github/workflows/windows-ci.yml | 7 ++----- 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/.github/workflows/ubuntu-ci.yml b/.github/workflows/ubuntu-ci.yml index fff4cee9..5eddcb6b 100644 --- a/.github/workflows/ubuntu-ci.yml +++ b/.github/workflows/ubuntu-ci.yml @@ -52,24 +52,18 @@ concurrency: jobs: ubuntu-ci: - strategy: - fail-fast: false - matrix: - fastdds-branch: - - '2.14.x' - - '2.13.x' if: ${{ !(github.event_name == 'pull_request') || !contains(github.event.pull_request.labels.*.name, 'conflicts') }} uses: ./.github/workflows/reusable-ubuntu-ci.yml with: # It would be desirable to have a matrix of ubuntu OS for this job, but due to the issue opened in this ticket: # https://github.com/orgs/community/discussions/128118 , it has been set as a single OS job. os-version: ${{ inputs.os-version || 'ubuntu-22.04' }} - label: 'ubuntu-ci-1.4.x-${{ matrix.fastdds-branch }}' + label: 'ubuntu-ci-1.4.x' colcon-args: ${{ inputs.colcon-args }} cmake-args: ${{ inputs.cmake-args }} ctest-args: ${{ inputs.ctest-args }} fastdds-python-branch: ${{ inputs.fastdds-python-branch || github.ref }} - fastdds-branch: ${{ inputs.fastdds-branch || matrix.fastdds-branch }} + fastdds-branch: ${{ inputs.fastdds-branch || '2.14.x' }} run-build: ${{ !(github.event_name == 'pull_request') || !contains(github.event.pull_request.labels.*.name, 'skip-ci') }} run-tests: ${{ (inputs.run-tests == true) || ((github.event_name == 'pull_request') && (!contains(github.event.pull_request.labels.*.name, 'no-test'))) }} use-ccache: ${{ inputs.use-ccache || false }} diff --git a/.github/workflows/windows-ci.yml b/.github/workflows/windows-ci.yml index bf2cb3ad..db164983 100644 --- a/.github/workflows/windows-ci.yml +++ b/.github/workflows/windows-ci.yml @@ -59,9 +59,6 @@ jobs: vs-toolset: - 'v141' - 'v142' - fastdds-branch: - - '2.14.x' - - '2.13.x' if: ${{ !(github.event_name == 'pull_request') || !contains(github.event.pull_request.labels.*.name, 'conflicts') }} uses: ./.github/workflows/reusable-windows-ci.yml with: @@ -69,11 +66,11 @@ jobs: # https://github.com/orgs/community/discussions/128118 , it has been set as a single OS job. os-version: ${{ inputs.os-version || 'windows-2019' }} vs-toolset: ${{ inputs.vs-toolset || matrix.vs-toolset }} - label: 'windows-${{ matrix.vs-toolset }}-ci-1.4.x-${{ matrix.fastdds-branch }}' + label: 'windows-${{ matrix.vs-toolset }}-ci-1.4.x' colcon-args: ${{ inputs.colcon-args }} cmake-args: ${{ inputs.cmake-args }} ctest-args: ${{ inputs.ctest-args }} fastdds-python-branch: ${{ inputs.fastdds-python-branch || github.ref }} - fastdds-branch: ${{ inputs.fastdds-branch || matrix.fastdds-branch }} + fastdds-branch: ${{ inputs.fastdds-branch || '2.14.x' }} run-build: ${{ !(github.event_name == 'pull_request') || !contains(github.event.pull_request.labels.*.name, 'skip-ci') }} run-tests: ${{ (inputs.run-tests == true) || ((github.event_name == 'pull_request') && (!contains(github.event.pull_request.labels.*.name, 'no-test'))) }} From b9fad451948d4c867a11fc655f66fdc65a15e8cd Mon Sep 17 00:00:00 2001 From: EugenioCollado <121509066+EugenioCollado@users.noreply.github.com> Date: Fri, 29 Nov 2024 10:26:01 +0100 Subject: [PATCH 11/17] Bump version to v1.4.3 (#199) Signed-off-by: Eugenio Collado --- fastdds_python/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fastdds_python/CMakeLists.txt b/fastdds_python/CMakeLists.txt index 3eedf30c..a622261a 100644 --- a/fastdds_python/CMakeLists.txt +++ b/fastdds_python/CMakeLists.txt @@ -24,7 +24,7 @@ if(POLICY CMP0086) cmake_policy(SET CMP0086 NEW) endif() -project(fastdds_python VERSION 1.4.2) +project(fastdds_python VERSION 1.4.3) # Set BUILD_TESTING to OFF by default. if(NOT BUILD_TESTING) From 9fba68dd6748df18dee3099af4fc4f5237152a01 Mon Sep 17 00:00:00 2001 From: EugenioCollado <121509066+EugenioCollado@users.noreply.github.com> Date: Fri, 29 Nov 2024 10:39:57 +0100 Subject: [PATCH 12/17] Regenerate types Fast-DDS-Gen v3.3.1 (#198) Signed-off-by: Eugenio Collado --- .../test/types/test_completePubSubTypes.cxx | 15 +++++++++++++++ .../types/test_included_modulesPubSubTypes.cxx | 5 +++++ .../test/types/test_modulesPubSubTypes.cxx | 15 +++++++++++++++ 3 files changed, 35 insertions(+) diff --git a/fastdds_python/test/types/test_completePubSubTypes.cxx b/fastdds_python/test/types/test_completePubSubTypes.cxx index 52fdae28..0a558f44 100644 --- a/fastdds_python/test/types/test_completePubSubTypes.cxx +++ b/fastdds_python/test/types/test_completePubSubTypes.cxx @@ -83,6 +83,11 @@ bool StructTypePubSubType::serialize( ser.serialize_encapsulation(); // Serialize the object. ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0,0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 } catch (eprosima::fastcdr::exception::Exception& /*exception*/) { @@ -279,6 +284,11 @@ bool CompleteTestTypePubSubType::serialize( ser.serialize_encapsulation(); // Serialize the object. ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0,0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 } catch (eprosima::fastcdr::exception::Exception& /*exception*/) { @@ -471,6 +481,11 @@ bool KeyedCompleteTestTypePubSubType::serialize( ser.serialize_encapsulation(); // Serialize the object. ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0,0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 } catch (eprosima::fastcdr::exception::Exception& /*exception*/) { diff --git a/fastdds_python/test/types/test_included_modulesPubSubTypes.cxx b/fastdds_python/test/types/test_included_modulesPubSubTypes.cxx index ab7ae72f..0404d8c2 100644 --- a/fastdds_python/test/types/test_included_modulesPubSubTypes.cxx +++ b/fastdds_python/test/types/test_included_modulesPubSubTypes.cxx @@ -85,6 +85,11 @@ namespace eprosima { ser.serialize_encapsulation(); // Serialize the object. ser << *p_type; + #if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0,0}); + #else + ser.setDDSCdrOptions(0); + #endif // FASTCDR_VERSION_MAJOR > 1 } catch (eprosima::fastcdr::exception::Exception& /*exception*/) { diff --git a/fastdds_python/test/types/test_modulesPubSubTypes.cxx b/fastdds_python/test/types/test_modulesPubSubTypes.cxx index 76edb1eb..de1aecdf 100644 --- a/fastdds_python/test/types/test_modulesPubSubTypes.cxx +++ b/fastdds_python/test/types/test_modulesPubSubTypes.cxx @@ -85,6 +85,11 @@ namespace eprosima { ser.serialize_encapsulation(); // Serialize the object. ser << *p_type; + #if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0,0}); + #else + ser.setDDSCdrOptions(0); + #endif // FASTCDR_VERSION_MAJOR > 1 } catch (eprosima::fastcdr::exception::Exception& /*exception*/) { @@ -281,6 +286,11 @@ namespace eprosima { ser.serialize_encapsulation(); // Serialize the object. ser << *p_type; + #if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0,0}); + #else + ser.setDDSCdrOptions(0); + #endif // FASTCDR_VERSION_MAJOR > 1 } catch (eprosima::fastcdr::exception::Exception& /*exception*/) { @@ -473,6 +483,11 @@ namespace eprosima { ser.serialize_encapsulation(); // Serialize the object. ser << *p_type; + #if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0,0}); + #else + ser.setDDSCdrOptions(0); + #endif // FASTCDR_VERSION_MAJOR > 1 } catch (eprosima::fastcdr::exception::Exception& /*exception*/) { From 3685455befda3cf2dc63a6f75f45982556ea2744 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Fri, 4 Apr 2025 13:12:53 +0200 Subject: [PATCH 13/17] Get correct Fast CDR related branch in CI (#226) * Add Fast CDR branch selection in reusable jobs (#220) Signed-off-by: Carlosespicur (cherry picked from commit c7b16789e0b0b0026658c5b47423bdb6e0e654db) * Update Fast CDR branch Signed-off-by: Carlosespicur * Skip base branch in Fast CDR branch selection Signed-off-by: Carlosespicur --------- Signed-off-by: Carlosespicur Co-authored-by: Carlos Espinoza Curto <148376273+Carlosespicur@users.noreply.github.com> Co-authored-by: Carlosespicur --- .github/workflows/reusable-ubuntu-ci.yml | 24 +++++++++++++++++++++-- .github/workflows/reusable-windows-ci.yml | 24 +++++++++++++++++++++-- 2 files changed, 44 insertions(+), 4 deletions(-) diff --git a/.github/workflows/reusable-ubuntu-ci.yml b/.github/workflows/reusable-ubuntu-ci.yml index 31779496..e8015865 100644 --- a/.github/workflows/reusable-ubuntu-ci.yml +++ b/.github/workflows/reusable-ubuntu-ci.yml @@ -25,13 +25,18 @@ on: required: false type: string fastdds-python-branch: - description: 'Branch or tag of Fast DDS Python repository' + description: 'Branch or tag of Fast DDS Python repository (https://github.com/eProsima/Fast-DDS-python)' required: true type: string fastdds-branch: - description: 'Branch or tag of Fast DDS repository' + description: 'Branch or tag of Fast DDS repository (https://github.com/eProsima/Fast-DDS)' required: true type: string + fastcdr-branch: + description: 'Branch or tag of Fast CDR repository (https://github.com/eProsima/Fast-CDR)' + required: false + type: string + default: '2.2.x' run-build: description: 'Build Fast DDS Python (CI skipped otherwise)' required: false @@ -108,6 +113,21 @@ jobs: with: api_token: ${{ secrets.GITHUB_TOKEN }} + - name: Get Fast CDR branch + id: get_fastcdr_branch + uses: eProsima/eProsima-CI/ubuntu/get_related_branch_from_repo@v0 + with: + remote_repository: eProsima/Fast-CDR + fallback_branch: ${{ inputs.fastcdr-branch }} + skip_base: true + + - name: Download Fast CDR + uses: eProsima/eProsima-CI/external/checkout@v0 + with: + repository: eProsima/Fast-CDR + path: ${{ github.workspace }}/src/fastcdr + ref: ${{ steps.get_fastcdr_branch.outputs.deduced_branch }} + - name: Get Fast DDS branch id: get_fastdds_branch uses: eProsima/eProsima-CI/ubuntu/get_related_branch_from_repo@v0 diff --git a/.github/workflows/reusable-windows-ci.yml b/.github/workflows/reusable-windows-ci.yml index 5b23342e..820ebf58 100644 --- a/.github/workflows/reusable-windows-ci.yml +++ b/.github/workflows/reusable-windows-ci.yml @@ -30,13 +30,18 @@ on: required: false type: string fastdds-python-branch: - description: 'Branch or tag of Fast DDS Python repository' + description: 'Branch or tag of Fast DDS Python repository (https://github.com/eProsima/Fast-DDS-python)' required: true type: string fastdds-branch: - description: 'Branch or tag of Fast DDS repository' + description: 'Branch or tag of Fast DDS repository (https://github.com/eProsima/Fast-DDS)' required: true type: string + fastcdr-branch: + description: 'Branch or tag of Fast CDR repository (https://github.com/eProsima/Fast-CDR)' + required: false + type: string + default: '2.2.x' run-build: description: 'Build Fast DDS Python (CI skipped otherwise)' required: false @@ -126,6 +131,21 @@ jobs: shell: pwsh run: choco install swig --allow-downgrade --version=4.0.2.04082020 + - name: Get Fast CDR branch + id: get_fastcdr_branch + uses: eProsima/eProsima-CI/ubuntu/get_related_branch_from_repo@v0 + with: + remote_repository: eProsima/Fast-CDR + fallback_branch: ${{ inputs.fastcdr-branch }} + skip_base: true + + - name: Download Fast CDR + uses: eProsima/eProsima-CI/external/checkout@v0 + with: + repository: eProsima/Fast-CDR + path: ${{ github.workspace }}/src/fastcdr + ref: ${{ steps.get_fastcdr_branch.outputs.deduced_branch }} + - name: Get Fast DDS branch id: get_fastdds_branch uses: eProsima/eProsima-CI/multiplatform/get_related_branch_from_repo@v0 From 7b7a574df347e88dac35872ea215b91cf40d6944 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Fri, 3 Oct 2025 12:57:49 +0200 Subject: [PATCH 14/17] Remove deprecated windows-2019 runner (#245) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Remove deprecated windows-2019 runner * Add matrix to windows-ci --------- (cherry picked from commit 19115c526b1a27266b457ac77943790555e6fa6f) Signed-off-by: Ricardo González Moreno Co-authored-by: Raul Sanchez-Mateos Lizano --- .github/workflows/reusable-windows-ci.yml | 2 +- .github/workflows/windows-ci.yml | 17 ++++++----------- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/.github/workflows/reusable-windows-ci.yml b/.github/workflows/reusable-windows-ci.yml index 820ebf58..765ab2c2 100644 --- a/.github/workflows/reusable-windows-ci.yml +++ b/.github/workflows/reusable-windows-ci.yml @@ -6,7 +6,7 @@ on: os-version: description: 'The OS image for the workflow' required: false - default: 'windows-2019' + default: 'windows-2022' type: string vs-toolset: description: 'The VS toolset to use for the build' diff --git a/.github/workflows/windows-ci.yml b/.github/workflows/windows-ci.yml index db164983..206d671d 100644 --- a/.github/workflows/windows-ci.yml +++ b/.github/workflows/windows-ci.yml @@ -6,12 +6,7 @@ on: os-version: description: 'OS version to run the workflow' required: false - default: 'windows-2019' - type: string - vs-toolset: - description: 'The VS toolset to use for the build' - required: false - default: 'v142' + default: 'windows-2022' type: string colcon-args: description: 'Extra arguments for colcon cli' @@ -53,20 +48,20 @@ concurrency: jobs: windows-ci: + if: ${{ !(github.event_name == 'pull_request') || !contains(github.event.pull_request.labels.*.name, 'conflicts') }} strategy: fail-fast: false matrix: vs-toolset: - - 'v141' - 'v142' - if: ${{ !(github.event_name == 'pull_request') || !contains(github.event.pull_request.labels.*.name, 'conflicts') }} + - 'v143' uses: ./.github/workflows/reusable-windows-ci.yml with: # It would be desirable to have a matrix of windows OS for this job, but due to the issue opened in this ticket: # https://github.com/orgs/community/discussions/128118 , it has been set as a single OS job. - os-version: ${{ inputs.os-version || 'windows-2019' }} - vs-toolset: ${{ inputs.vs-toolset || matrix.vs-toolset }} - label: 'windows-${{ matrix.vs-toolset }}-ci-1.4.x' + os-version: ${{ inputs.os-version || 'windows-2022' }} + vs-toolset: ${{ matrix.vs-toolset }} + label: '${{ inputs.os-version }}-${{ matrix.vs-toolset }}-ci-${{ inputs.fastdds-python-branch }}-${{ inputs.fastdds-branch }}' colcon-args: ${{ inputs.colcon-args }} cmake-args: ${{ inputs.cmake-args }} ctest-args: ${{ inputs.ctest-args }} From f54bc8f7ec941d0ed2b15ab1b64fff74bd7bca09 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Mon, 6 Oct 2025 11:25:54 +0200 Subject: [PATCH 15/17] Remove compilation warning with InstanceHandle_t (#265) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Refs #23753. Take into account dependencies for rebuild * Refs #23753. Fix warning * Refs #23753. Remove swig warnings * Refs #23753. Add unit tests * Refs #23753. Apply suggestions --------- (cherry picked from commit 6ee4ca570cb2df39a82209bd2c3d9784ebaf9172) Signed-off-by: Ricardo González Moreno Co-authored-by: Ricardo González --- fastdds_python/src/swig/CMakeLists.txt | 1 + .../swig/fastdds/rtps/common/InstanceHandle.i | 183 ++++++++++++++---- fastdds_python/test/CMakeLists.txt | 10 + .../dds/common/test_InstanceHandle.py | 150 ++++++++++++++ 4 files changed, 307 insertions(+), 37 deletions(-) create mode 100644 fastdds_python/test/unittest/dds/common/test_InstanceHandle.py diff --git a/fastdds_python/src/swig/CMakeLists.txt b/fastdds_python/src/swig/CMakeLists.txt index c30d7820..ebfd9889 100644 --- a/fastdds_python/src/swig/CMakeLists.txt +++ b/fastdds_python/src/swig/CMakeLists.txt @@ -27,6 +27,7 @@ set(${PROJECT_NAME}_MODULE set(${PROJECT_NAME}_FILES ${${PROJECT_NAME}_MODULE}.i ) +set_property(SOURCE ${${PROJECT_NAME}_FILE} PROPERTY USE_SWIG_DEPENDENCIES TRUE) SET_SOURCE_FILES_PROPERTIES( ${${PROJECT_NAME}_FILES} diff --git a/fastdds_python/src/swig/fastdds/rtps/common/InstanceHandle.i b/fastdds_python/src/swig/fastdds/rtps/common/InstanceHandle.i index 5ea7b280..96218a0a 100644 --- a/fastdds_python/src/swig/fastdds/rtps/common/InstanceHandle.i +++ b/fastdds_python/src/swig/fastdds/rtps/common/InstanceHandle.i @@ -13,6 +13,9 @@ // limitations under the License. %{ +#include +#include + #include "fastdds/rtps/common/InstanceHandle.h" // Define a hash method in global scope for InstanceHandle_t types @@ -26,60 +29,119 @@ long hash(const eprosima::fastrtps::rtps::InstanceHandle_t& handle) } return ret; } - %} // SWIG does not support type conversion operators correctly unless converted to a normal method %rename(get_guid) eprosima::fastrtps::rtps::InstanceHandle_t::operator const GUID_t&; %ignore eprosima::fastrtps::rtps::InstanceHandleValue_t::operator [] const; +%ignore eprosima::fastrtps::rtps::InstanceHandleValue_t::operator []; %ignore eprosima::fastrtps::rtps::operator <<(std::ostream&, const InstanceHandle_t&); %ignore eprosima::fastrtps::rtps::operator >>(std::istream&, InstanceHandle_t&); -%rename(read_pointer_cast) eprosima::fastrtps::rtps::InstanceHandleValue_t::operator const octet* () const; -%rename(write_pointer_cast) eprosima::fastrtps::rtps::InstanceHandleValue_t::operator octet* (); - -%typemap(in) eprosima::fastrtps::rtps::InstanceHandleValue_t*(eprosima::fastrtps::rtps::InstanceHandleValue_t temp) -{ - if (PyTuple_Check($input)) - { - eprosima::fastrtps::rtps::octet* buf = temp; - if (!PyArg_ParseTuple($input, "BBBBBBBBBBBBBBBB", - buf, buf+1, buf+2, buf+3, buf+4, buf+5, buf+6, buf+7, buf+8, - buf+9, buf+10, buf+11, buf+12, buf+13, buf+14, buf+15)) +%ignore eprosima::fastrtps::rtps::InstanceHandleValue_t::operator const octet* () const; +%ignore eprosima::fastrtps::rtps::InstanceHandleValue_t::operator octet* (); + +%extend eprosima::fastrtps::rtps::InstanceHandleValue_t { + + // Constructor from a sequence of 16 bytes (tuple/list/bytes/bytearray) + InstanceHandleValue_t(PyObject* seq) { + eprosima::fastrtps::rtps::InstanceHandleValue_t* self = new eprosima::fastrtps::rtps::InstanceHandleValue_t(); + SWIG_PYTHON_THREAD_BEGIN_BLOCK; + + // Fast-path: bytes + if (PyBytes_Check(seq)) { + if (PyBytes_GET_SIZE(seq) == 16) + { + const char* b = PyBytes_AS_STRING(seq); + for (int i = 0; i < 16; ++i) (*self)[i] = (uint8_t)(unsigned char)b[i]; + } + else + { + delete self; + self = nullptr; + PyErr_SetString(PyExc_ValueError, "Expected 16 bytes"); + } + } + // Fast-path: bytearray + else if (PyByteArray_Check(seq)) { - PyErr_SetString(PyExc_TypeError, "tuple must have 16 elements"); - SWIG_fail; + if (PyByteArray_GET_SIZE(seq) == 16) + { + const char* b = PyByteArray_AS_STRING(seq); + for (int i = 0; i < 16; ++i) (*self)[i] = (uint8_t)(unsigned char)b[i]; + } + else + { + delete self; + self = nullptr; + PyErr_SetString(PyExc_ValueError, "Expected 16 bytes"); + } } - $1 = &temp; - } - else - { - PyErr_SetString(PyExc_TypeError, "expected a tuple."); - SWIG_fail; + else + { + // Generic fallback: iterable from 16 ints 0..255 + PyObject* it = PyObject_GetIter(seq); + size_t count {0}; + if (it) + { + PyObject* item {nullptr}; + while ((item = PyIter_Next(it)) && count < 16) + { + long val = PyLong_AsLong(item); + Py_DECREF(item); + if (val == -1 && PyErr_Occurred()) + { + delete self; + self = nullptr; + PyErr_SetString(PyExc_TypeError, "Sequence must contain integers"); + break; + } + else if (val < 0 || val > 255) + { + delete self; + self = nullptr; + PyErr_SetString(PyExc_ValueError, "Each value must be in 0..255"); + break; + } + + (*self)[count] = static_cast(val); + ++count; + } + Py_DECREF(it); + if ((nullptr != item || count != 16) && nullptr != self) + { + delete self; + self = nullptr; + PyErr_SetString(PyExc_ValueError, "Expected 16 elements"); + } + } + else + { + delete self; + self = nullptr; + PyErr_SetString(PyExc_TypeError, "Expected a sequence of 16 integers (0..255) or 16-byte object"); + } + } + + SWIG_PYTHON_THREAD_END_BLOCK; + + return self; } -} -%typemap(out) eprosima::fastrtps::rtps::InstanceHandleValue_t* -{ - constexpr size_t ih_size = std::tuple_size::value; - PyObject* python_tuple = PyTuple_New(ih_size); + size_t __len__() const { return 16; } - if (python_tuple) - { - for(size_t count = 0; count < ih_size; ++count) - { - PyTuple_SetItem(python_tuple, count, PyInt_FromLong((*$1)[count])); - } + uint8_t __getitem__(size_t i) const { + if (i >= 16) throw std::out_of_range("index out of range"); + return $self->operator[](i); } - $result = python_tuple; + void __setitem__(size_t i, uint8_t v) { + if (i >= 16) throw std::out_of_range("index out of range"); + $self->operator[](i) = v; + } } -// Template for std::vector -%template(InstanceHandleVector) std::vector; -%typemap(doctype) std::vector"InstanceHandleVector"; - -%include "fastdds/rtps/common/InstanceHandle.h" +%ignore eprosima::fastrtps::rtps::InstanceHandle_t::value; // Declare the comparison operators as internal to the class %extend eprosima::fastrtps::rtps::InstanceHandle_t { @@ -106,4 +168,51 @@ long hash(const eprosima::fastrtps::rtps::InstanceHandle_t& handle) { return hash(*$self); } + + // Setter from sequence (tuple/list/bytes/bytearray) + void from_sequence(PyObject* seq) { + // Reuse the constructor to validate and copy + eprosima::fastrtps::rtps::InstanceHandleValue_t* tmp = new_eprosima_fastrtps_rtps_InstanceHandleValue_t(seq); + if (nullptr != tmp) + { + for (int i = 0; i < 16; ++i) $self->value[i] = (*tmp)[i]; + delete tmp; // avoid memory leak + } + } + + // Getter: return a tuple of 16 ints (0..255) + PyObject* to_sequence() const { + SWIG_PYTHON_THREAD_BEGIN_BLOCK; + + PyObject* python_tuple = PyTuple_New(16); + + if (python_tuple) + { + for(size_t count = 0; count < 16; ++count) + { + PyTuple_SetItem(python_tuple, count, PyInt_FromLong($self->value[count])); + } + } + + SWIG_PYTHON_THREAD_END_BLOCK; + + return python_tuple; + } } + +// Template for std::vector +%template(InstanceHandleVector) std::vector; +%typemap(doctype) std::vector"InstanceHandleVector"; + +%include "fastdds/rtps/common/InstanceHandle.h" + +%pythoncode %{ +def _ihv_get_value(self): + return self.to_sequence() + +def _ihv_set_value(self, seq): + self.from_sequence(seq) + +InstanceHandle_t.value = property(_ihv_get_value, _ihv_set_value, + doc="16-byte value as list/tuple/bytes/bytearray") +%} diff --git a/fastdds_python/test/CMakeLists.txt b/fastdds_python/test/CMakeLists.txt index 7a5df110..2fe2b6ea 100644 --- a/fastdds_python/test/CMakeLists.txt +++ b/fastdds_python/test/CMakeLists.txt @@ -20,7 +20,17 @@ if (${fastcdr_VERSION_MAJOR} EQUAL 1) set(fastcdr_version_argument "v1") endif() +# Unit tests +add_test(NAME unit_tests + COMMAND + ${Python3_EXECUTABLE} + -m pytest + -vrP + WORKING_DIRECTORY + ${CMAKE_CURRENT_SOURCE_DIR}/unittest + ) +# DDS Api tests add_test(NAME api_tests COMMAND ${Python3_EXECUTABLE} diff --git a/fastdds_python/test/unittest/dds/common/test_InstanceHandle.py b/fastdds_python/test/unittest/dds/common/test_InstanceHandle.py new file mode 100644 index 00000000..f1f9714b --- /dev/null +++ b/fastdds_python/test/unittest/dds/common/test_InstanceHandle.py @@ -0,0 +1,150 @@ +# until https://bugs.python.org/issue46276 is not fixed we can apply this +# workaround on windows +import os + +if os.name == "nt": + import win32api + + win32api.LoadLibrary("test_complete") + +import fastdds +import pytest +import sys + + +def test_create_instance_handle_from_bytes(): + ih = fastdds.InstanceHandle_t() + ih.value = b"\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" + assert (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16) == ih.value + + +def test_create_instance_handle_from_bytearray(): + ih = fastdds.InstanceHandle_t() + ih.value = bytearray([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]) + assert (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16) == ih.value + + +def test_create_instance_handle_from_tuple(): + ih = fastdds.InstanceHandle_t() + ih.value = (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16) + assert (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16) == ih.value + + +def test_create_instance_handle_from_list(): + ih = fastdds.InstanceHandle_t() + ih.value = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16] + assert (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16) == ih.value + + +def test_create_instance_handle_from_bytes_with_less_elements(): + ih = fastdds.InstanceHandle_t() + with pytest.raises(SystemError) as exception: + ih.value = b"\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e" + repr = exception.getrepr() + assert str(repr).split("\n")[0] == "ValueError: Expected 16 bytes" + + +def test_create_instance_handle_from_bytes_with_more_elements(): + ih = fastdds.InstanceHandle_t() + with pytest.raises(SystemError) as exception: + ih.value = ( + b"\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11\x12" + ) + repr = exception.getrepr() + assert str(repr).split("\n")[0] == "ValueError: Expected 16 bytes" + + +def test_create_instance_handle_from_bytearray_with_less_elements(): + ih = fastdds.InstanceHandle_t() + with pytest.raises(SystemError) as exception: + ih.value = bytearray([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14]) + repr = exception.getrepr() + assert str(repr).split("\n")[0] == "ValueError: Expected 16 bytes" + + +def test_create_instance_handle_from_bytearray_with_more_elements(): + ih = fastdds.InstanceHandle_t() + with pytest.raises(SystemError) as exception: + ih.value = bytearray( + [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18] + ) + repr = exception.getrepr() + assert str(repr).split("\n")[0] == "ValueError: Expected 16 bytes" + + +def test_create_instance_handle_from_tuple_with_less_elements(): + ih = fastdds.InstanceHandle_t() + with pytest.raises(SystemError) as exception: + ih.value = (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14) + repr = exception.getrepr() + assert str(repr).split("\n")[0] == "ValueError: Expected 16 elements" + + +def test_create_instance_handle_from_tuple_with_more_elements(): + ih = fastdds.InstanceHandle_t() + with pytest.raises(SystemError) as exception: + ih.value = (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18) + repr = exception.getrepr() + assert str(repr).split("\n")[0] == "ValueError: Expected 16 elements" + + +def test_create_instance_handle_from_list_with_less_elements(): + ih = fastdds.InstanceHandle_t() + with pytest.raises(SystemError) as exception: + ih.value = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14] + repr = exception.getrepr() + assert str(repr).split("\n")[0] == "ValueError: Expected 16 elements" + + +def test_create_instance_handle_from_list_with_more_elements(): + ih = fastdds.InstanceHandle_t() + with pytest.raises(SystemError) as exception: + ih.value = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18] + repr = exception.getrepr() + assert str(repr).split("\n")[0] == "ValueError: Expected 16 elements" + + +def test_create_instance_handle_from_bytearray_with_with_negative_number(): + ih = fastdds.InstanceHandle_t() + with pytest.raises(ValueError) as exception: + ih.value = bytearray([1, 2, 3, 4, 5, 6, 7, 8, 9, -10, 11, 12, 13, 14, 15, 16]) + assert str(exception.value) == "byte must be in range(0, 256)" + + +def test_create_instance_handle_from_bytearray_with_large_number(): + ih = fastdds.InstanceHandle_t() + with pytest.raises(ValueError) as exception: + ih.value = bytearray([1, 2, 3, 4, 5, 6, 7, 8, 9, 1000, 11, 12, 13, 14, 15, 16]) + assert str(exception.value) == "byte must be in range(0, 256)" + + +def test_create_instance_handle_from_tuple_with_negative_number(): + ih = fastdds.InstanceHandle_t() + with pytest.raises(SystemError) as exception: + ih.value = (1, 2, 3, 4, 5, 6, 7, 8, 9, -10, 11, 12, 13, 14, -15, 16) + repr = exception.getrepr() + assert str(repr).split("\n")[0] == "ValueError: Each value must be in 0..255" + + +def test_create_instance_handle_from_tuple_with_large_number(): + ih = fastdds.InstanceHandle_t() + with pytest.raises(SystemError) as exception: + ih.value = (1, 2, 3, 4, 5, 6, 7, 8, 9, 1000, 11, 12, 13, 14, 15, 16) + repr = exception.getrepr() + assert str(repr).split("\n")[0] == "ValueError: Each value must be in 0..255" + + +def test_create_instance_handle_from_list_with_negative_number(): + ih = fastdds.InstanceHandle_t() + with pytest.raises(SystemError) as exception: + ih.value = [1, 2, 3, 4, 5, 6, 7, 8, 9, -10, 11, 12, 13, 14, 15, 16] + repr = exception.getrepr() + assert str(repr).split("\n")[0] == "ValueError: Each value must be in 0..255" + + +def test_create_instance_handle_from_list_with_large_number(): + ih = fastdds.InstanceHandle_t() + with pytest.raises(SystemError) as exception: + ih.value = [1, 2, 3, 4, 5, 6, 7, 8, 9, 1000, 11, 12, 13, 14, 15, 16] + repr = exception.getrepr() + assert str(repr).split("\n")[0] == "ValueError: Each value must be in 0..255" From 2ec9e13e6cf54331308b83e15a9da6b422b797a9 Mon Sep 17 00:00:00 2001 From: Emilio Cuesta Fernandez Date: Mon, 9 Feb 2026 09:28:49 +0100 Subject: [PATCH 16/17] Regenerate types with Fast DDS Gen 3.3.2 (#284) Signed-off-by: Emilio Cuesta --- fastdds_python/test/types/CMakeLists.txt | 23 +- fastdds_python/test/types/test_complete.cxx | 2 +- fastdds_python/test/types/test_complete.h | 2 +- fastdds_python/test/types/test_complete.i | 2 +- .../test/types/test_completeCdrAux.hpp | 2 +- .../test/types/test_completeCdrAux.ipp | 2 +- .../test/types/test_completePubSubTypes.cxx | 184 +-- .../test/types/test_completePubSubTypes.h | 17 +- .../test/types/test_completePubSubTypes.i | 2 +- fastdds_python/test/types/test_completev1.cxx | 2 +- fastdds_python/test/types/test_completev1.h | 2 +- .../test/types/test_included_modules.cxx | 2 +- .../test/types/test_included_modules.h | 2 +- .../test/types/test_included_modules.i | 2 +- .../types/test_included_modulesCdrAux.hpp | 2 +- .../types/test_included_modulesCdrAux.ipp | 2 +- .../test_included_modulesPubSubTypes.cxx | 362 +++--- .../types/test_included_modulesPubSubTypes.h | 147 ++- .../types/test_included_modulesPubSubTypes.i | 2 +- .../test/types/test_included_modulesv1.cxx | 2 +- .../test/types/test_included_modulesv1.h | 2 +- fastdds_python/test/types/test_modules.cxx | 2 +- fastdds_python/test/types/test_modules.h | 2 +- fastdds_python/test/types/test_modules.i | 2 +- .../test/types/test_modulesCdrAux.hpp | 2 +- .../test/types/test_modulesCdrAux.ipp | 2 +- .../test/types/test_modulesPubSubTypes.cxx | 1134 ++++++++--------- .../test/types/test_modulesPubSubTypes.h | 415 +++--- .../test/types/test_modulesPubSubTypes.i | 2 +- fastdds_python/test/types/test_modulesv1.cxx | 2 +- fastdds_python/test/types/test_modulesv1.h | 2 +- .../HelloWorldExample/CMakeLists.txt | 9 +- .../HelloWorldExample/HelloWorld.cxx | 2 +- .../HelloWorldExample/HelloWorld.h | 2 +- .../HelloWorldExample/HelloWorld.i | 2 +- .../HelloWorldExample/HelloWorldCdrAux.hpp | 2 +- .../HelloWorldExample/HelloWorldCdrAux.ipp | 2 +- .../HelloWorldPubSubTypes.cxx | 67 +- .../HelloWorldExample/HelloWorldPubSubTypes.h | 7 +- .../HelloWorldExample/HelloWorldPubSubTypes.i | 2 +- .../HelloWorldExample/HelloWorldv1.cxx | 2 +- .../HelloWorldExample/HelloWorldv1.h | 2 +- 42 files changed, 1139 insertions(+), 1290 deletions(-) diff --git a/fastdds_python/test/types/CMakeLists.txt b/fastdds_python/test/types/CMakeLists.txt index b718edb0..557c338a 100644 --- a/fastdds_python/test/types/CMakeLists.txt +++ b/fastdds_python/test/types/CMakeLists.txt @@ -1,5 +1,5 @@ -cmake_minimum_required(VERSION 3.22) +cmake_minimum_required(VERSION 3.20) # SWIG: use standard target name. if(POLICY CMP0078) @@ -27,6 +27,13 @@ find_package(fastrtps REQUIRED) set(CMAKE_POSITION_INDEPENDENT_CODE ON) +if(NOT WIN32) + # Default values for shared library suffix in MacOS + if(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin") + set(CMAKE_SHARED_LIBRARY_SUFFIX ".so") + endif() +endif() + #Create library for C++ types add_library(${PROJECT_NAME} SHARED test_included_modules.cxx @@ -135,6 +142,13 @@ find_package(fastrtps REQUIRED) set(CMAKE_POSITION_INDEPENDENT_CODE ON) +if(NOT WIN32) + # Default values for shared library suffix in MacOS + if(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin") + set(CMAKE_SHARED_LIBRARY_SUFFIX ".so") + endif() +endif() + #Create library for C++ types add_library(${PROJECT_NAME} SHARED test_modules.cxx @@ -243,6 +257,13 @@ find_package(fastrtps REQUIRED) set(CMAKE_POSITION_INDEPENDENT_CODE ON) +if(NOT WIN32) + # Default values for shared library suffix in MacOS + if(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin") + set(CMAKE_SHARED_LIBRARY_SUFFIX ".so") + endif() +endif() + #Create library for C++ types add_library(${PROJECT_NAME} SHARED test_complete.cxx diff --git a/fastdds_python/test/types/test_complete.cxx b/fastdds_python/test/types/test_complete.cxx index f930ea78..97c93510 100644 --- a/fastdds_python/test/types/test_complete.cxx +++ b/fastdds_python/test/types/test_complete.cxx @@ -16,7 +16,7 @@ * @file test_complete.cpp * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool fastddsgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 diff --git a/fastdds_python/test/types/test_complete.h b/fastdds_python/test/types/test_complete.h index 7a0b8a52..368f107f 100644 --- a/fastdds_python/test/types/test_complete.h +++ b/fastdds_python/test/types/test_complete.h @@ -16,7 +16,7 @@ * @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 fastddsgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #include diff --git a/fastdds_python/test/types/test_complete.i b/fastdds_python/test/types/test_complete.i index 629d3567..861631dd 100644 --- a/fastdds_python/test/types/test_complete.i +++ b/fastdds_python/test/types/test_complete.i @@ -16,7 +16,7 @@ * @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 fastddsgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ %module test_complete diff --git a/fastdds_python/test/types/test_completeCdrAux.hpp b/fastdds_python/test/types/test_completeCdrAux.hpp index 25dd9394..3441e139 100644 --- a/fastdds_python/test/types/test_completeCdrAux.hpp +++ b/fastdds_python/test/types/test_completeCdrAux.hpp @@ -16,7 +16,7 @@ * @file test_completeCdrAux.hpp * This source file contains some definitions of CDR related functions. * - * This file was generated by the tool fastddsgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_TEST_COMPLETECDRAUX_HPP_ diff --git a/fastdds_python/test/types/test_completeCdrAux.ipp b/fastdds_python/test/types/test_completeCdrAux.ipp index 213ea1e8..f1da6c2f 100644 --- a/fastdds_python/test/types/test_completeCdrAux.ipp +++ b/fastdds_python/test/types/test_completeCdrAux.ipp @@ -16,7 +16,7 @@ * @file test_completeCdrAux.ipp * This source file contains some declarations of CDR related functions. * - * This file was generated by the tool fastddsgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_TEST_COMPLETECDRAUX_IPP_ diff --git a/fastdds_python/test/types/test_completePubSubTypes.cxx b/fastdds_python/test/types/test_completePubSubTypes.cxx index 0a558f44..1a2bd439 100644 --- a/fastdds_python/test/types/test_completePubSubTypes.cxx +++ b/fastdds_python/test/types/test_completePubSubTypes.cxx @@ -16,10 +16,13 @@ * @file test_completePubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastddsgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ +#include +#include + #include #include "test_completePubSubTypes.h" @@ -43,17 +46,10 @@ StructTypePubSubType::StructTypePubSubType() 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); } StructTypePubSubType::~StructTypePubSubType() { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } } bool StructTypePubSubType::serialize( @@ -61,7 +57,8 @@ bool StructTypePubSubType::serialize( SerializedPayload_t* payload, DataRepresentationId_t data_representation) { - StructType* p_type = static_cast(data); + StructType* p_type = + static_cast(data); // Object that manages the raw buffer. eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); @@ -84,7 +81,7 @@ bool StructTypePubSubType::serialize( // Serialize the object. ser << *p_type; #if FASTCDR_VERSION_MAJOR > 1 - ser.set_dds_cdr_options({0,0}); + ser.set_dds_cdr_options({0, 0}); #else ser.setDDSCdrOptions(0); #endif // FASTCDR_VERSION_MAJOR > 1 @@ -110,7 +107,8 @@ bool StructTypePubSubType::deserialize( try { // Convert DATA to pointer of your type - StructType* p_type = static_cast(data); + StructType* p_type = + static_cast(data); // Object that manages the raw buffer. eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); @@ -182,46 +180,11 @@ bool StructTypePubSubType::getKey( InstanceHandle_t* handle, bool force_md5) { - if (!m_isGetKeyDefined) - { - return false; - } - - StructType* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - StructType_max_key_cdr_typesize); + static_cast(data); + static_cast(handle); + static_cast(force_md5); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); -#if FASTCDR_VERSION_MAJOR == 1 - p_type->serializeKey(ser); -#else - eprosima::fastcdr::serialize_key(ser, *p_type); -#endif // FASTCDR_VERSION_MAJOR == 1 - if (force_md5 || StructType_max_key_cdr_typesize > 16) - { - m_md5.init(); -#if FASTCDR_VERSION_MAJOR == 1 - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); -#else - m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); -#endif // FASTCDR_VERSION_MAJOR == 1 - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; + return false; } @@ -232,6 +195,7 @@ bool StructTypePubSubType::getKey( + CompleteTestTypePubSubType::CompleteTestTypePubSubType() { setName("CompleteTestType"); @@ -244,17 +208,10 @@ CompleteTestTypePubSubType::CompleteTestTypePubSubType() 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); } CompleteTestTypePubSubType::~CompleteTestTypePubSubType() { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } } bool CompleteTestTypePubSubType::serialize( @@ -262,7 +219,8 @@ bool CompleteTestTypePubSubType::serialize( SerializedPayload_t* payload, DataRepresentationId_t data_representation) { - CompleteTestType* p_type = static_cast(data); + CompleteTestType* p_type = + static_cast(data); // Object that manages the raw buffer. eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); @@ -285,7 +243,7 @@ bool CompleteTestTypePubSubType::serialize( // Serialize the object. ser << *p_type; #if FASTCDR_VERSION_MAJOR > 1 - ser.set_dds_cdr_options({0,0}); + ser.set_dds_cdr_options({0, 0}); #else ser.setDDSCdrOptions(0); #endif // FASTCDR_VERSION_MAJOR > 1 @@ -311,7 +269,8 @@ bool CompleteTestTypePubSubType::deserialize( try { // Convert DATA to pointer of your type - CompleteTestType* p_type = static_cast(data); + CompleteTestType* p_type = + static_cast(data); // Object that manages the raw buffer. eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); @@ -383,52 +342,18 @@ bool CompleteTestTypePubSubType::getKey( InstanceHandle_t* handle, bool force_md5) { - if (!m_isGetKeyDefined) - { - return false; - } - - CompleteTestType* p_type = static_cast(data); + static_cast(data); + static_cast(handle); + static_cast(force_md5); - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - CompleteTestType_max_key_cdr_typesize); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); -#if FASTCDR_VERSION_MAJOR == 1 - p_type->serializeKey(ser); -#else - eprosima::fastcdr::serialize_key(ser, *p_type); -#endif // FASTCDR_VERSION_MAJOR == 1 - if (force_md5 || CompleteTestType_max_key_cdr_typesize > 16) - { - m_md5.init(); -#if FASTCDR_VERSION_MAJOR == 1 - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); -#else - m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); -#endif // FASTCDR_VERSION_MAJOR == 1 - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; + return false; } + KeyedCompleteTestTypePubSubType::KeyedCompleteTestTypePubSubType() { setName("KeyedCompleteTestType"); @@ -441,16 +366,15 @@ KeyedCompleteTestTypePubSubType::KeyedCompleteTestTypePubSubType() 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); + key_buffer_ = nullptr; + get_key_buffer_nts(); } KeyedCompleteTestTypePubSubType::~KeyedCompleteTestTypePubSubType() { - if (m_keyBuffer != nullptr) + if (key_buffer_ != nullptr) { - free(m_keyBuffer); + free(key_buffer_); } } @@ -459,7 +383,8 @@ bool KeyedCompleteTestTypePubSubType::serialize( SerializedPayload_t* payload, DataRepresentationId_t data_representation) { - KeyedCompleteTestType* p_type = static_cast(data); + KeyedCompleteTestType* p_type = + static_cast(data); // Object that manages the raw buffer. eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); @@ -482,7 +407,7 @@ bool KeyedCompleteTestTypePubSubType::serialize( // Serialize the object. ser << *p_type; #if FASTCDR_VERSION_MAJOR > 1 - ser.set_dds_cdr_options({0,0}); + ser.set_dds_cdr_options({0, 0}); #else ser.setDDSCdrOptions(0); #endif // FASTCDR_VERSION_MAJOR > 1 @@ -508,7 +433,8 @@ bool KeyedCompleteTestTypePubSubType::deserialize( try { // Convert DATA to pointer of your type - KeyedCompleteTestType* p_type = static_cast(data); + KeyedCompleteTestType* p_type = + static_cast(data); // Object that manages the raw buffer. eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); @@ -580,19 +506,26 @@ bool KeyedCompleteTestTypePubSubType::getKey( InstanceHandle_t* handle, bool force_md5) { - if (!m_isGetKeyDefined) + std::lock_guard guard(compute_key_mtx_); + KeyedCompleteTestType* p_type = + static_cast(data); + + // Ensure the key buffer is reserved + unsigned char* key_buffer = get_key_buffer_nts(); + if (key_buffer == nullptr) { return false; } - KeyedCompleteTestType* p_type = static_cast(data); - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(key_buffer), KeyedCompleteTestType_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); + eprosima::fastcdr::Cdr ser( + fastbuffer, + eprosima::fastcdr::Cdr::BIG_ENDIANNESS, + eprosima::fastcdr::CdrVersion::XCDRv1); #if FASTCDR_VERSION_MAJOR == 1 p_type->serializeKey(ser); #else @@ -600,25 +533,40 @@ bool KeyedCompleteTestTypePubSubType::getKey( #endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || KeyedCompleteTestType_max_key_cdr_typesize > 16) { - m_md5.init(); + MD5 md5; + md5.init(); #if FASTCDR_VERSION_MAJOR == 1 - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + md5.update(key_buffer, static_cast(ser.getSerializedDataLength())); #else - m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); + md5.update(key_buffer, static_cast(ser.get_serialized_data_length())); #endif // FASTCDR_VERSION_MAJOR == 1 - m_md5.finalize(); + md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { - handle->value[i] = m_md5.digest[i]; + handle->value[i] = md5.digest[i]; } } else { for (uint8_t i = 0; i < 16; ++i) { - handle->value[i] = m_keyBuffer[i]; + handle->value[i] = key_buffer[i]; } } return true; } +unsigned char* KeyedCompleteTestTypePubSubType::get_key_buffer_nts() +{ + // If already reserved, return + if (key_buffer_ != nullptr) + { + return key_buffer_; + } + + // Allocate the key buffer + uint32_t key_length = (std::max)(KeyedCompleteTestType_max_key_cdr_typesize, 16u); + key_buffer_ = reinterpret_cast(calloc(key_length, 1u)); + return key_buffer_; +} + diff --git a/fastdds_python/test/types/test_completePubSubTypes.h b/fastdds_python/test/types/test_completePubSubTypes.h index d77cf3d3..01d31ae8 100644 --- a/fastdds_python/test/types/test_completePubSubTypes.h +++ b/fastdds_python/test/types/test_completePubSubTypes.h @@ -16,13 +16,15 @@ * @file test_completePubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastddsgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_TEST_COMPLETE_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_TEST_COMPLETE_PUBSUBTYPES_H_ +#include + #include #include #include @@ -124,9 +126,6 @@ class StructTypePubSubType : public eprosima::fastdds::dds::TopicDataType #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - MD5 m_md5; - unsigned char* m_keyBuffer; - }; @@ -220,9 +219,6 @@ class CompleteTestTypePubSubType : public eprosima::fastdds::dds::TopicDataType #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - MD5 m_md5; - unsigned char* m_keyBuffer; - }; @@ -312,9 +308,12 @@ class KeyedCompleteTestTypePubSubType : public eprosima::fastdds::dds::TopicData #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - MD5 m_md5; - unsigned char* m_keyBuffer; +private: + + unsigned char* key_buffer_ = nullptr; + std::mutex compute_key_mtx_; + unsigned char* get_key_buffer_nts(); }; #endif // _FAST_DDS_GENERATED_TEST_COMPLETE_PUBSUBTYPES_H_ diff --git a/fastdds_python/test/types/test_completePubSubTypes.i b/fastdds_python/test/types/test_completePubSubTypes.i index 2c68f927..08e3c962 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 fastddsgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ %import(module="fastdds") "fastdds/dds/topic/TopicDataType.hpp"; diff --git a/fastdds_python/test/types/test_completev1.cxx b/fastdds_python/test/types/test_completev1.cxx index 2bd17df1..e0637b49 100644 --- a/fastdds_python/test/types/test_completev1.cxx +++ b/fastdds_python/test/types/test_completev1.cxx @@ -16,7 +16,7 @@ * @file test_complete.cpp * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool fastddsgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 diff --git a/fastdds_python/test/types/test_completev1.h b/fastdds_python/test/types/test_completev1.h index 7258f061..091a1399 100644 --- a/fastdds_python/test/types/test_completev1.h +++ b/fastdds_python/test/types/test_completev1.h @@ -16,7 +16,7 @@ * @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 fastddsgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #include diff --git a/fastdds_python/test/types/test_included_modules.cxx b/fastdds_python/test/types/test_included_modules.cxx index d7e43b32..48459cc8 100644 --- a/fastdds_python/test/types/test_included_modules.cxx +++ b/fastdds_python/test/types/test_included_modules.cxx @@ -16,7 +16,7 @@ * @file test_included_modules.cpp * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool fastddsgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 diff --git a/fastdds_python/test/types/test_included_modules.h b/fastdds_python/test/types/test_included_modules.h index d9254d64..8937f14b 100644 --- a/fastdds_python/test/types/test_included_modules.h +++ b/fastdds_python/test/types/test_included_modules.h @@ -16,7 +16,7 @@ * @file test_included_modules.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool fastddsgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #include diff --git a/fastdds_python/test/types/test_included_modules.i b/fastdds_python/test/types/test_included_modules.i index ab3c0b66..552cf00d 100644 --- a/fastdds_python/test/types/test_included_modules.i +++ b/fastdds_python/test/types/test_included_modules.i @@ -16,7 +16,7 @@ * @file test_included_modules.i * This header file contains the SWIG interface of the described types in the IDL file. * - * This file was generated by the tool fastddsgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ %module test_included_modules diff --git a/fastdds_python/test/types/test_included_modulesCdrAux.hpp b/fastdds_python/test/types/test_included_modulesCdrAux.hpp index 2724149f..36ef618b 100644 --- a/fastdds_python/test/types/test_included_modulesCdrAux.hpp +++ b/fastdds_python/test/types/test_included_modulesCdrAux.hpp @@ -16,7 +16,7 @@ * @file test_included_modulesCdrAux.hpp * This source file contains some definitions of CDR related functions. * - * This file was generated by the tool fastddsgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_EPROSIMA_TEST2_TEST_INCLUDED_MODULESCDRAUX_HPP_ diff --git a/fastdds_python/test/types/test_included_modulesCdrAux.ipp b/fastdds_python/test/types/test_included_modulesCdrAux.ipp index 7ea181f8..bf76f46b 100644 --- a/fastdds_python/test/types/test_included_modulesCdrAux.ipp +++ b/fastdds_python/test/types/test_included_modulesCdrAux.ipp @@ -16,7 +16,7 @@ * @file test_included_modulesCdrAux.ipp * This source file contains some declarations of CDR related functions. * - * This file was generated by the tool fastddsgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_EPROSIMA_TEST2_TEST_INCLUDED_MODULESCDRAUX_IPP_ diff --git a/fastdds_python/test/types/test_included_modulesPubSubTypes.cxx b/fastdds_python/test/types/test_included_modulesPubSubTypes.cxx index 0404d8c2..b34cfd8c 100644 --- a/fastdds_python/test/types/test_included_modulesPubSubTypes.cxx +++ b/fastdds_python/test/types/test_included_modulesPubSubTypes.cxx @@ -16,10 +16,13 @@ * @file test_included_modulesPubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastddsgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ +#include +#include + #include #include "test_included_modulesPubSubTypes.h" @@ -30,204 +33,165 @@ using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace eprosima { - namespace test2 { - - - StructType2PubSubType::StructType2PubSubType() - { - setName("eprosima::test2::StructType2"); - uint32_t type_size = - #if FASTCDR_VERSION_MAJOR == 1 - static_cast(StructType2::getMaxCdrSerializedSize()); - #else - eprosima_test2_StructType2_max_cdr_typesize; - #endif - 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 = eprosima_test2_StructType2_max_key_cdr_typesize > 16 ? eprosima_test2_StructType2_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - StructType2PubSubType::~StructType2PubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool StructType2PubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) - { - StructType2* 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, - 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; - #if FASTCDR_VERSION_MAJOR > 1 - ser.set_encoding_flag( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); - #endif // FASTCDR_VERSION_MAJOR > 1 - - try - { - // Serialize encapsulation - ser.serialize_encapsulation(); - // Serialize the object. - ser << *p_type; - #if FASTCDR_VERSION_MAJOR > 1 - ser.set_dds_cdr_options({0,0}); - #else - ser.setDDSCdrOptions(0); - #endif // FASTCDR_VERSION_MAJOR > 1 - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - // Get the serialized length - #if FASTCDR_VERSION_MAJOR == 1 - payload->length = static_cast(ser.getSerializedDataLength()); - #else - payload->length = static_cast(ser.get_serialized_data_length()); - #endif // FASTCDR_VERSION_MAJOR == 1 - return true; - } - - bool StructType2PubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - try - { - // Convert DATA to pointer of your type - StructType2* p_type = static_cast(data); - - // Object that manages the raw buffer. - 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 - #if FASTCDR_VERSION_MAJOR == 1 - , eprosima::fastcdr::Cdr::CdrType::DDS_CDR - #endif // FASTCDR_VERSION_MAJOR == 1 - ); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - // Deserialize the object. - deser >> *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - return true; - } - - std::function StructType2PubSubType::getSerializedSizeProvider( - void* data, - DataRepresentationId_t data_representation) - { - return [data, data_representation]() -> uint32_t - { - #if FASTCDR_VERSION_MAJOR == 1 - static_cast(data_representation); - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - #else - try - { - 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*/; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return 0; - } - #endif // FASTCDR_VERSION_MAJOR == 1 - }; - } - - void* StructType2PubSubType::createData() - { - return reinterpret_cast(new StructType2()); - } - - void StructType2PubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool StructType2PubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - StructType2* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - eprosima_test2_StructType2_max_key_cdr_typesize); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); - #if FASTCDR_VERSION_MAJOR == 1 - p_type->serializeKey(ser); - #else - eprosima::fastcdr::serialize_key(ser, *p_type); - #endif // FASTCDR_VERSION_MAJOR == 1 - if (force_md5 || eprosima_test2_StructType2_max_key_cdr_typesize > 16) - { - m_md5.init(); - #if FASTCDR_VERSION_MAJOR == 1 - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - #else - m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); - #endif // FASTCDR_VERSION_MAJOR == 1 - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace test2 +namespace test2 { + + +StructType2PubSubType::StructType2PubSubType() +{ + setName("eprosima::test2::StructType2"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(StructType2::getMaxCdrSerializedSize()); +#else + eprosima_test2_StructType2_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +StructType2PubSubType::~StructType2PubSubType() +{ +} + +bool StructType2PubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + StructType2* 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, + 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; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool StructType2PubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + StructType2* p_type = + static_cast(data); + + // Object that manages the raw buffer. + 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 +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function StructType2PubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + 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*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* StructType2PubSubType::createData() +{ + return reinterpret_cast(new StructType2()); +} + +void StructType2PubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool StructType2PubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace test2 } //End of namespace eprosima diff --git a/fastdds_python/test/types/test_included_modulesPubSubTypes.h b/fastdds_python/test/types/test_included_modulesPubSubTypes.h index a9962d68..c56c1d90 100644 --- a/fastdds_python/test/types/test_included_modulesPubSubTypes.h +++ b/fastdds_python/test/types/test_included_modulesPubSubTypes.h @@ -16,13 +16,15 @@ * @file test_included_modulesPubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastddsgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_EPROSIMA_TEST2_TEST_INCLUDED_MODULES_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_EPROSIMA_TEST2_TEST_INCLUDED_MODULES_PUBSUBTYPES_H_ +#include + #include #include #include @@ -37,102 +39,97 @@ Generated test_included_modules is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace eprosima -{ - namespace test2 - { +namespace eprosima { +namespace test2 { - /*! - * @brief This class represents the TopicDataType of the type StructType2 defined by the user in the IDL file. - * @ingroup test_included_modules - */ - class StructType2PubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: - - typedef StructType2 type; +/*! + * @brief This class represents the TopicDataType of the type StructType2 defined by the user in the IDL file. + * @ingroup test_included_modules + */ +class StructType2PubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: - eProsima_user_DllExport StructType2PubSubType(); + typedef StructType2 type; - eProsima_user_DllExport ~StructType2PubSubType() override; + eProsima_user_DllExport StructType2PubSubType(); - 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 ~StructType2PubSubType() override; - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) 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 bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport void* createData() override; + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; - eProsima_user_DllExport void deleteData( - void* data) override; + eProsima_user_DllExport void* createData() override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return false; - } + eProsima_user_DllExport void deleteData( + void* data) override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return false; - } +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } - MD5 m_md5; - unsigned char* m_keyBuffer; +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - }; - } -} +}; +} // namespace test2 +} // namespace eprosima #endif // _FAST_DDS_GENERATED_EPROSIMA_TEST2_TEST_INCLUDED_MODULES_PUBSUBTYPES_H_ diff --git a/fastdds_python/test/types/test_included_modulesPubSubTypes.i b/fastdds_python/test/types/test_included_modulesPubSubTypes.i index 3c3a2891..b4ae8b80 100644 --- a/fastdds_python/test/types/test_included_modulesPubSubTypes.i +++ b/fastdds_python/test/types/test_included_modulesPubSubTypes.i @@ -16,7 +16,7 @@ * @file test_included_modulesPubSubTypes.i * This header file contains the SWIG interface of the serialization functions. * - * This file was generated by the tool fastddsgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ %import(module="fastdds") "fastdds/dds/topic/TopicDataType.hpp"; diff --git a/fastdds_python/test/types/test_included_modulesv1.cxx b/fastdds_python/test/types/test_included_modulesv1.cxx index 58c44802..a862701f 100644 --- a/fastdds_python/test/types/test_included_modulesv1.cxx +++ b/fastdds_python/test/types/test_included_modulesv1.cxx @@ -16,7 +16,7 @@ * @file test_included_modules.cpp * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool fastddsgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 diff --git a/fastdds_python/test/types/test_included_modulesv1.h b/fastdds_python/test/types/test_included_modulesv1.h index de5eb0f8..0eea6b43 100644 --- a/fastdds_python/test/types/test_included_modulesv1.h +++ b/fastdds_python/test/types/test_included_modulesv1.h @@ -16,7 +16,7 @@ * @file test_included_modules.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool fastddsgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #include diff --git a/fastdds_python/test/types/test_modules.cxx b/fastdds_python/test/types/test_modules.cxx index 1f07eea0..ba842d69 100644 --- a/fastdds_python/test/types/test_modules.cxx +++ b/fastdds_python/test/types/test_modules.cxx @@ -16,7 +16,7 @@ * @file test_modules.cpp * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool fastddsgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 diff --git a/fastdds_python/test/types/test_modules.h b/fastdds_python/test/types/test_modules.h index a74ede6d..b5bdf4e0 100644 --- a/fastdds_python/test/types/test_modules.h +++ b/fastdds_python/test/types/test_modules.h @@ -16,7 +16,7 @@ * @file test_modules.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool fastddsgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #include diff --git a/fastdds_python/test/types/test_modules.i b/fastdds_python/test/types/test_modules.i index b26a9895..768c97c3 100644 --- a/fastdds_python/test/types/test_modules.i +++ b/fastdds_python/test/types/test_modules.i @@ -16,7 +16,7 @@ * @file test_modules.i * This header file contains the SWIG interface of the described types in the IDL file. * - * This file was generated by the tool fastddsgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ %module test_modules diff --git a/fastdds_python/test/types/test_modulesCdrAux.hpp b/fastdds_python/test/types/test_modulesCdrAux.hpp index f591f9ec..7a5dc407 100644 --- a/fastdds_python/test/types/test_modulesCdrAux.hpp +++ b/fastdds_python/test/types/test_modulesCdrAux.hpp @@ -16,7 +16,7 @@ * @file test_modulesCdrAux.hpp * This source file contains some definitions of CDR related functions. * - * This file was generated by the tool fastddsgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_EPROSIMA_TEST_TEST_MODULESCDRAUX_HPP_ diff --git a/fastdds_python/test/types/test_modulesCdrAux.ipp b/fastdds_python/test/types/test_modulesCdrAux.ipp index 1ae1d7f7..08a7b1e6 100644 --- a/fastdds_python/test/types/test_modulesCdrAux.ipp +++ b/fastdds_python/test/types/test_modulesCdrAux.ipp @@ -16,7 +16,7 @@ * @file test_modulesCdrAux.ipp * This source file contains some declarations of CDR related functions. * - * This file was generated by the tool fastddsgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_EPROSIMA_TEST_TEST_MODULESCDRAUX_IPP_ diff --git a/fastdds_python/test/types/test_modulesPubSubTypes.cxx b/fastdds_python/test/types/test_modulesPubSubTypes.cxx index de1aecdf..bfbd0dad 100644 --- a/fastdds_python/test/types/test_modulesPubSubTypes.cxx +++ b/fastdds_python/test/types/test_modulesPubSubTypes.cxx @@ -16,10 +16,13 @@ * @file test_modulesPubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastddsgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ +#include +#include + #include #include "test_modulesPubSubTypes.h" @@ -30,602 +33,547 @@ using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace eprosima { - namespace test { - - - StructTypePubSubType::StructTypePubSubType() - { - setName("eprosima::test::StructType"); - uint32_t type_size = - #if FASTCDR_VERSION_MAJOR == 1 - static_cast(StructType::getMaxCdrSerializedSize()); - #else - eprosima_test_StructType_max_cdr_typesize; - #endif - 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 = eprosima_test_StructType_max_key_cdr_typesize > 16 ? eprosima_test_StructType_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - StructTypePubSubType::~StructTypePubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool StructTypePubSubType::serialize( - void* data, - 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, - 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; - #if FASTCDR_VERSION_MAJOR > 1 - ser.set_encoding_flag( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); - #endif // FASTCDR_VERSION_MAJOR > 1 - - try - { - // Serialize encapsulation - ser.serialize_encapsulation(); - // Serialize the object. - ser << *p_type; - #if FASTCDR_VERSION_MAJOR > 1 - ser.set_dds_cdr_options({0,0}); - #else - ser.setDDSCdrOptions(0); - #endif // FASTCDR_VERSION_MAJOR > 1 - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - // Get the serialized length - #if FASTCDR_VERSION_MAJOR == 1 - payload->length = static_cast(ser.getSerializedDataLength()); - #else - payload->length = static_cast(ser.get_serialized_data_length()); - #endif // FASTCDR_VERSION_MAJOR == 1 - return true; - } - - bool StructTypePubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - try - { - // Convert DATA to pointer of your type - StructType* p_type = static_cast(data); - - // Object that manages the raw buffer. - 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 - #if FASTCDR_VERSION_MAJOR == 1 - , eprosima::fastcdr::Cdr::CdrType::DDS_CDR - #endif // FASTCDR_VERSION_MAJOR == 1 - ); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - // Deserialize the object. - deser >> *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - return true; - } - - std::function StructTypePubSubType::getSerializedSizeProvider( - void* data, - DataRepresentationId_t data_representation) - { - return [data, data_representation]() -> uint32_t - { - #if FASTCDR_VERSION_MAJOR == 1 - static_cast(data_representation); - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - #else - try - { - 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*/; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return 0; - } - #endif // FASTCDR_VERSION_MAJOR == 1 - }; - } - - void* StructTypePubSubType::createData() - { - return reinterpret_cast(new StructType()); - } - - void StructTypePubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool StructTypePubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - StructType* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - eprosima_test_StructType_max_key_cdr_typesize); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); - #if FASTCDR_VERSION_MAJOR == 1 - p_type->serializeKey(ser); - #else - eprosima::fastcdr::serialize_key(ser, *p_type); - #endif // FASTCDR_VERSION_MAJOR == 1 - if (force_md5 || eprosima_test_StructType_max_key_cdr_typesize > 16) - { - m_md5.init(); - #if FASTCDR_VERSION_MAJOR == 1 - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - #else - m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); - #endif // FASTCDR_VERSION_MAJOR == 1 - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - - - - - - - - CompleteTestTypePubSubType::CompleteTestTypePubSubType() - { - setName("eprosima::test::CompleteTestType"); - uint32_t type_size = - #if FASTCDR_VERSION_MAJOR == 1 - static_cast(CompleteTestType::getMaxCdrSerializedSize()); - #else - eprosima_test_CompleteTestType_max_cdr_typesize; - #endif - 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 = eprosima_test_CompleteTestType_max_key_cdr_typesize > 16 ? eprosima_test_CompleteTestType_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - CompleteTestTypePubSubType::~CompleteTestTypePubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool CompleteTestTypePubSubType::serialize( - void* data, - 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, - 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; - #if FASTCDR_VERSION_MAJOR > 1 - ser.set_encoding_flag( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); - #endif // FASTCDR_VERSION_MAJOR > 1 - - try - { - // Serialize encapsulation - ser.serialize_encapsulation(); - // Serialize the object. - ser << *p_type; - #if FASTCDR_VERSION_MAJOR > 1 - ser.set_dds_cdr_options({0,0}); - #else - ser.setDDSCdrOptions(0); - #endif // FASTCDR_VERSION_MAJOR > 1 - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - // Get the serialized length - #if FASTCDR_VERSION_MAJOR == 1 - payload->length = static_cast(ser.getSerializedDataLength()); - #else - payload->length = static_cast(ser.get_serialized_data_length()); - #endif // FASTCDR_VERSION_MAJOR == 1 - return true; - } - - bool CompleteTestTypePubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - try - { - // Convert DATA to pointer of your type - CompleteTestType* p_type = static_cast(data); - - // Object that manages the raw buffer. - 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 - #if FASTCDR_VERSION_MAJOR == 1 - , eprosima::fastcdr::Cdr::CdrType::DDS_CDR - #endif // FASTCDR_VERSION_MAJOR == 1 - ); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - // Deserialize the object. - deser >> *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - return true; - } - - std::function CompleteTestTypePubSubType::getSerializedSizeProvider( - void* data, - DataRepresentationId_t data_representation) - { - return [data, data_representation]() -> uint32_t - { - #if FASTCDR_VERSION_MAJOR == 1 - static_cast(data_representation); - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - #else - try - { - 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*/; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return 0; - } - #endif // FASTCDR_VERSION_MAJOR == 1 - }; - } - - void* CompleteTestTypePubSubType::createData() - { - return reinterpret_cast(new CompleteTestType()); - } - - void CompleteTestTypePubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool CompleteTestTypePubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - CompleteTestType* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - eprosima_test_CompleteTestType_max_key_cdr_typesize); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); - #if FASTCDR_VERSION_MAJOR == 1 - p_type->serializeKey(ser); - #else - eprosima::fastcdr::serialize_key(ser, *p_type); - #endif // FASTCDR_VERSION_MAJOR == 1 - if (force_md5 || eprosima_test_CompleteTestType_max_key_cdr_typesize > 16) - { - m_md5.init(); - #if FASTCDR_VERSION_MAJOR == 1 - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - #else - m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); - #endif // FASTCDR_VERSION_MAJOR == 1 - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - - - - KeyedCompleteTestTypePubSubType::KeyedCompleteTestTypePubSubType() +namespace test { + + +StructTypePubSubType::StructTypePubSubType() +{ + setName("eprosima::test::StructType"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(StructType::getMaxCdrSerializedSize()); +#else + eprosima_test_StructType_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +StructTypePubSubType::~StructTypePubSubType() +{ +} + +bool StructTypePubSubType::serialize( + void* data, + 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, + 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; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool StructTypePubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + StructType* p_type = + static_cast(data); + + // Object that manages the raw buffer. + 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 +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function StructTypePubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + 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*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* StructTypePubSubType::createData() +{ + return reinterpret_cast(new StructType()); +} + +void StructTypePubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool StructTypePubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + + + + + + + + +CompleteTestTypePubSubType::CompleteTestTypePubSubType() +{ + setName("eprosima::test::CompleteTestType"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(CompleteTestType::getMaxCdrSerializedSize()); +#else + eprosima_test_CompleteTestType_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +CompleteTestTypePubSubType::~CompleteTestTypePubSubType() +{ +} + +bool CompleteTestTypePubSubType::serialize( + void* data, + 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, + 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; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool CompleteTestTypePubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + CompleteTestType* p_type = + static_cast(data); + + // Object that manages the raw buffer. + 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 +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function CompleteTestTypePubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + 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*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* CompleteTestTypePubSubType::createData() +{ + return reinterpret_cast(new CompleteTestType()); +} + +void CompleteTestTypePubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool CompleteTestTypePubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + + + + +KeyedCompleteTestTypePubSubType::KeyedCompleteTestTypePubSubType() +{ + setName("eprosima::test::KeyedCompleteTestType"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(KeyedCompleteTestType::getMaxCdrSerializedSize()); +#else + eprosima_test_KeyedCompleteTestType_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = true; + key_buffer_ = nullptr; + get_key_buffer_nts(); +} + +KeyedCompleteTestTypePubSubType::~KeyedCompleteTestTypePubSubType() +{ + if (key_buffer_ != nullptr) + { + free(key_buffer_); + } +} + +bool KeyedCompleteTestTypePubSubType::serialize( + void* data, + 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, + 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; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool KeyedCompleteTestTypePubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + KeyedCompleteTestType* p_type = + static_cast(data); + + // Object that manages the raw buffer. + 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 +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function KeyedCompleteTestTypePubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + 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*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* KeyedCompleteTestTypePubSubType::createData() +{ + return reinterpret_cast(new KeyedCompleteTestType()); +} + +void KeyedCompleteTestTypePubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool KeyedCompleteTestTypePubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + std::lock_guard guard(compute_key_mtx_); + KeyedCompleteTestType* p_type = + static_cast(data); + + // Ensure the key buffer is reserved + unsigned char* key_buffer = get_key_buffer_nts(); + if (key_buffer == nullptr) + { + return false; + } + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(key_buffer), + eprosima_test_KeyedCompleteTestType_max_key_cdr_typesize); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser( + fastbuffer, + eprosima::fastcdr::Cdr::BIG_ENDIANNESS, + eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else + eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 + if (force_md5 || eprosima_test_KeyedCompleteTestType_max_key_cdr_typesize > 16) + { + MD5 md5; + md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + md5.update(key_buffer, static_cast(ser.getSerializedDataLength())); +#else + md5.update(key_buffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 + md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) { - setName("eprosima::test::KeyedCompleteTestType"); - uint32_t type_size = - #if FASTCDR_VERSION_MAJOR == 1 - static_cast(KeyedCompleteTestType::getMaxCdrSerializedSize()); - #else - eprosima_test_KeyedCompleteTestType_max_cdr_typesize; - #endif - 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 = eprosima_test_KeyedCompleteTestType_max_key_cdr_typesize > 16 ? eprosima_test_KeyedCompleteTestType_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); + handle->value[i] = md5.digest[i]; } - - KeyedCompleteTestTypePubSubType::~KeyedCompleteTestTypePubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool KeyedCompleteTestTypePubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) + } + else + { + for (uint8_t i = 0; i < 16; ++i) { - 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, - 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; - #if FASTCDR_VERSION_MAJOR > 1 - ser.set_encoding_flag( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); - #endif // FASTCDR_VERSION_MAJOR > 1 - - try - { - // Serialize encapsulation - ser.serialize_encapsulation(); - // Serialize the object. - ser << *p_type; - #if FASTCDR_VERSION_MAJOR > 1 - ser.set_dds_cdr_options({0,0}); - #else - ser.setDDSCdrOptions(0); - #endif // FASTCDR_VERSION_MAJOR > 1 - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - // Get the serialized length - #if FASTCDR_VERSION_MAJOR == 1 - payload->length = static_cast(ser.getSerializedDataLength()); - #else - payload->length = static_cast(ser.get_serialized_data_length()); - #endif // FASTCDR_VERSION_MAJOR == 1 - return true; + handle->value[i] = key_buffer[i]; } - - bool KeyedCompleteTestTypePubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - try - { - // Convert DATA to pointer of your type - KeyedCompleteTestType* p_type = static_cast(data); - - // Object that manages the raw buffer. - 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 - #if FASTCDR_VERSION_MAJOR == 1 - , eprosima::fastcdr::Cdr::CdrType::DDS_CDR - #endif // FASTCDR_VERSION_MAJOR == 1 - ); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - // Deserialize the object. - deser >> *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - return true; - } - - std::function KeyedCompleteTestTypePubSubType::getSerializedSizeProvider( - void* data, - DataRepresentationId_t data_representation) - { - return [data, data_representation]() -> uint32_t - { - #if FASTCDR_VERSION_MAJOR == 1 - static_cast(data_representation); - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - #else - try - { - 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*/; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return 0; - } - #endif // FASTCDR_VERSION_MAJOR == 1 - }; - } - - void* KeyedCompleteTestTypePubSubType::createData() - { - return reinterpret_cast(new KeyedCompleteTestType()); - } - - void KeyedCompleteTestTypePubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool KeyedCompleteTestTypePubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - KeyedCompleteTestType* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - eprosima_test_KeyedCompleteTestType_max_key_cdr_typesize); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); - #if FASTCDR_VERSION_MAJOR == 1 - p_type->serializeKey(ser); - #else - eprosima::fastcdr::serialize_key(ser, *p_type); - #endif // FASTCDR_VERSION_MAJOR == 1 - if (force_md5 || eprosima_test_KeyedCompleteTestType_max_key_cdr_typesize > 16) - { - m_md5.init(); - #if FASTCDR_VERSION_MAJOR == 1 - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - #else - m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); - #endif // FASTCDR_VERSION_MAJOR == 1 - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace test + } + return true; +} + +unsigned char* KeyedCompleteTestTypePubSubType::get_key_buffer_nts() +{ + // If already reserved, return + if (key_buffer_ != nullptr) + { + return key_buffer_; + } + + // Allocate the key buffer + uint32_t key_length = (std::max)(eprosima_test_KeyedCompleteTestType_max_key_cdr_typesize, 16u); + key_buffer_ = reinterpret_cast(calloc(key_length, 1u)); + return key_buffer_; +} + + +} //End of namespace test } //End of namespace eprosima diff --git a/fastdds_python/test/types/test_modulesPubSubTypes.h b/fastdds_python/test/types/test_modulesPubSubTypes.h index 50415835..2f6974f1 100644 --- a/fastdds_python/test/types/test_modulesPubSubTypes.h +++ b/fastdds_python/test/types/test_modulesPubSubTypes.h @@ -16,13 +16,15 @@ * @file test_modulesPubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastddsgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_EPROSIMA_TEST_TEST_MODULES_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_EPROSIMA_TEST_TEST_MODULES_PUBSUBTYPES_H_ +#include + #include #include #include @@ -37,100 +39,95 @@ Generated test_modules is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace eprosima -{ - namespace test - { - +namespace eprosima { +namespace test { - /*! - * @brief This class represents the TopicDataType of the type StructType defined by the user in the IDL file. - * @ingroup test_modules - */ - class StructTypePubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: - typedef StructType type; +/*! + * @brief This class represents the TopicDataType of the type StructType defined by the user in the IDL file. + * @ingroup test_modules + */ +class StructTypePubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: - eProsima_user_DllExport StructTypePubSubType(); + typedef StructType type; - eProsima_user_DllExport ~StructTypePubSubType() override; + eProsima_user_DllExport StructTypePubSubType(); - 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 ~StructTypePubSubType() override; - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) 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 bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport void* createData() override; + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; - eProsima_user_DllExport void deleteData( - void* data) override; + eProsima_user_DllExport void* createData() override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return false; - } + eProsima_user_DllExport void deleteData( + void* data) override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return false; - } +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } - MD5 m_md5; - unsigned char* m_keyBuffer; +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - }; +}; @@ -140,187 +137,187 @@ namespace eprosima - /*! - * @brief This class represents the TopicDataType of the type CompleteTestType defined by the user in the IDL file. - * @ingroup test_modules - */ - class CompleteTestTypePubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: +/*! + * @brief This class represents the TopicDataType of the type CompleteTestType defined by the user in the IDL file. + * @ingroup test_modules + */ +class CompleteTestTypePubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: - typedef CompleteTestType type; + typedef CompleteTestType type; - eProsima_user_DllExport CompleteTestTypePubSubType(); + eProsima_user_DllExport CompleteTestTypePubSubType(); - eProsima_user_DllExport ~CompleteTestTypePubSubType() override; + eProsima_user_DllExport ~CompleteTestTypePubSubType() 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 bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - 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) 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 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 bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; - eProsima_user_DllExport void* createData() override; + eProsima_user_DllExport void* createData() override; - eProsima_user_DllExport void deleteData( - void* data) override; + eProsima_user_DllExport void deleteData( + void* data) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return false; - } +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return false; - } +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - 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 +#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 - { - static_cast(memory); - return false; - } +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - MD5 m_md5; - unsigned char* m_keyBuffer; +}; - }; +/*! + * @brief This class represents the TopicDataType of the type KeyedCompleteTestType defined by the user in the IDL file. + * @ingroup test_modules + */ +class KeyedCompleteTestTypePubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: - /*! - * @brief This class represents the TopicDataType of the type KeyedCompleteTestType defined by the user in the IDL file. - * @ingroup test_modules - */ - class KeyedCompleteTestTypePubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: + typedef KeyedCompleteTestType type; - typedef KeyedCompleteTestType type; + eProsima_user_DllExport KeyedCompleteTestTypePubSubType(); - eProsima_user_DllExport KeyedCompleteTestTypePubSubType(); + eProsima_user_DllExport ~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 bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override - { - return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - eProsima_user_DllExport bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + 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) 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 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 bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; + eProsima_user_DllExport void* createData() override; - eProsima_user_DllExport void* createData() override; + eProsima_user_DllExport void deleteData( + void* data) override; - eProsima_user_DllExport void deleteData( - void* data) override; +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return false; - } +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return false; - } + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + 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 - #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 + { + static_cast(memory); + return false; + } - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE +private: - MD5 m_md5; - unsigned char* m_keyBuffer; + unsigned char* key_buffer_ = nullptr; + std::mutex compute_key_mtx_; - }; - } -} + unsigned char* get_key_buffer_nts(); +}; +} // namespace test +} // namespace eprosima #endif // _FAST_DDS_GENERATED_EPROSIMA_TEST_TEST_MODULES_PUBSUBTYPES_H_ diff --git a/fastdds_python/test/types/test_modulesPubSubTypes.i b/fastdds_python/test/types/test_modulesPubSubTypes.i index f3b1a453..09b019f0 100644 --- a/fastdds_python/test/types/test_modulesPubSubTypes.i +++ b/fastdds_python/test/types/test_modulesPubSubTypes.i @@ -16,7 +16,7 @@ * @file test_modulesPubSubTypes.i * This header file contains the SWIG interface of the serialization functions. * - * This file was generated by the tool fastddsgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ %import(module="fastdds") "fastdds/dds/topic/TopicDataType.hpp"; diff --git a/fastdds_python/test/types/test_modulesv1.cxx b/fastdds_python/test/types/test_modulesv1.cxx index 9122a6fc..7d1b03b2 100644 --- a/fastdds_python/test/types/test_modulesv1.cxx +++ b/fastdds_python/test/types/test_modulesv1.cxx @@ -16,7 +16,7 @@ * @file test_modules.cpp * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool fastddsgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 diff --git a/fastdds_python/test/types/test_modulesv1.h b/fastdds_python/test/types/test_modulesv1.h index 4bee87f3..0fb2e0af 100644 --- a/fastdds_python/test/types/test_modulesv1.h +++ b/fastdds_python/test/types/test_modulesv1.h @@ -16,7 +16,7 @@ * @file test_modules.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool fastddsgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #include diff --git a/fastdds_python_examples/HelloWorldExample/CMakeLists.txt b/fastdds_python_examples/HelloWorldExample/CMakeLists.txt index 75aa5e75..67f75ec2 100644 --- a/fastdds_python_examples/HelloWorldExample/CMakeLists.txt +++ b/fastdds_python_examples/HelloWorldExample/CMakeLists.txt @@ -1,5 +1,5 @@ -cmake_minimum_required(VERSION 3.22) +cmake_minimum_required(VERSION 3.20) # SWIG: use standard target name. if(POLICY CMP0078) @@ -27,6 +27,13 @@ find_package(fastrtps REQUIRED) set(CMAKE_POSITION_INDEPENDENT_CODE ON) +if(NOT WIN32) + # Default values for shared library suffix in MacOS + if(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin") + set(CMAKE_SHARED_LIBRARY_SUFFIX ".so") + endif() +endif() + #Create library for C++ types add_library(${PROJECT_NAME} SHARED HelloWorld.cxx diff --git a/fastdds_python_examples/HelloWorldExample/HelloWorld.cxx b/fastdds_python_examples/HelloWorldExample/HelloWorld.cxx index 4b415d67..cb25330a 100644 --- a/fastdds_python_examples/HelloWorldExample/HelloWorld.cxx +++ b/fastdds_python_examples/HelloWorldExample/HelloWorld.cxx @@ -16,7 +16,7 @@ * @file HelloWorld.cpp * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool fastddsgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 diff --git a/fastdds_python_examples/HelloWorldExample/HelloWorld.h b/fastdds_python_examples/HelloWorldExample/HelloWorld.h index 5cd0ddba..a721ac5a 100644 --- a/fastdds_python_examples/HelloWorldExample/HelloWorld.h +++ b/fastdds_python_examples/HelloWorldExample/HelloWorld.h @@ -16,7 +16,7 @@ * @file HelloWorld.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool fastddsgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #include diff --git a/fastdds_python_examples/HelloWorldExample/HelloWorld.i b/fastdds_python_examples/HelloWorldExample/HelloWorld.i index 5af81f0a..5ea8840f 100644 --- a/fastdds_python_examples/HelloWorldExample/HelloWorld.i +++ b/fastdds_python_examples/HelloWorldExample/HelloWorld.i @@ -16,7 +16,7 @@ * @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 fastddsgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ %module HelloWorld diff --git a/fastdds_python_examples/HelloWorldExample/HelloWorldCdrAux.hpp b/fastdds_python_examples/HelloWorldExample/HelloWorldCdrAux.hpp index 9f346d30..ebbd2274 100644 --- a/fastdds_python_examples/HelloWorldExample/HelloWorldCdrAux.hpp +++ b/fastdds_python_examples/HelloWorldExample/HelloWorldCdrAux.hpp @@ -16,7 +16,7 @@ * @file HelloWorldCdrAux.hpp * This source file contains some definitions of CDR related functions. * - * This file was generated by the tool fastddsgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_HELLOWORLDCDRAUX_HPP_ diff --git a/fastdds_python_examples/HelloWorldExample/HelloWorldCdrAux.ipp b/fastdds_python_examples/HelloWorldExample/HelloWorldCdrAux.ipp index 42e91f3c..60361ab9 100644 --- a/fastdds_python_examples/HelloWorldExample/HelloWorldCdrAux.ipp +++ b/fastdds_python_examples/HelloWorldExample/HelloWorldCdrAux.ipp @@ -16,7 +16,7 @@ * @file HelloWorldCdrAux.ipp * This source file contains some declarations of CDR related functions. * - * This file was generated by the tool fastddsgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_HELLOWORLDCDRAUX_IPP_ diff --git a/fastdds_python_examples/HelloWorldExample/HelloWorldPubSubTypes.cxx b/fastdds_python_examples/HelloWorldExample/HelloWorldPubSubTypes.cxx index 85cb4778..6dbf2431 100644 --- a/fastdds_python_examples/HelloWorldExample/HelloWorldPubSubTypes.cxx +++ b/fastdds_python_examples/HelloWorldExample/HelloWorldPubSubTypes.cxx @@ -16,10 +16,13 @@ * @file HelloWorldPubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastddsgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ +#include +#include + #include #include "HelloWorldPubSubTypes.h" @@ -43,17 +46,10 @@ HelloWorldPubSubType::HelloWorldPubSubType() 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); } HelloWorldPubSubType::~HelloWorldPubSubType() { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } } bool HelloWorldPubSubType::serialize( @@ -61,7 +57,8 @@ bool HelloWorldPubSubType::serialize( SerializedPayload_t* payload, DataRepresentationId_t data_representation) { - HelloWorld* p_type = static_cast(data); + HelloWorld* p_type = + static_cast(data); // Object that manages the raw buffer. eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); @@ -83,6 +80,11 @@ bool HelloWorldPubSubType::serialize( ser.serialize_encapsulation(); // Serialize the object. ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 } catch (eprosima::fastcdr::exception::Exception& /*exception*/) { @@ -105,7 +107,8 @@ bool HelloWorldPubSubType::deserialize( try { // Convert DATA to pointer of your type - HelloWorld* p_type = static_cast(data); + HelloWorld* p_type = + static_cast(data); // Object that manages the raw buffer. eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); @@ -177,45 +180,11 @@ bool HelloWorldPubSubType::getKey( InstanceHandle_t* handle, bool force_md5) { - if (!m_isGetKeyDefined) - { - return false; - } - - HelloWorld* p_type = static_cast(data); + static_cast(data); + static_cast(handle); + static_cast(force_md5); - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - HelloWorld_max_key_cdr_typesize); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); -#if FASTCDR_VERSION_MAJOR == 1 - p_type->serializeKey(ser); -#else - eprosima::fastcdr::serialize_key(ser, *p_type); -#endif // FASTCDR_VERSION_MAJOR == 1 - if (force_md5 || HelloWorld_max_key_cdr_typesize > 16) - { - m_md5.init(); -#if FASTCDR_VERSION_MAJOR == 1 - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); -#else - m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); -#endif // FASTCDR_VERSION_MAJOR == 1 - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; + return false; } + diff --git a/fastdds_python_examples/HelloWorldExample/HelloWorldPubSubTypes.h b/fastdds_python_examples/HelloWorldExample/HelloWorldPubSubTypes.h index cb61cd6b..9e0150ad 100644 --- a/fastdds_python_examples/HelloWorldExample/HelloWorldPubSubTypes.h +++ b/fastdds_python_examples/HelloWorldExample/HelloWorldPubSubTypes.h @@ -16,13 +16,15 @@ * @file HelloWorldPubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastddsgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_HELLOWORLD_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_HELLOWORLD_PUBSUBTYPES_H_ +#include + #include #include #include @@ -123,9 +125,6 @@ class HelloWorldPubSubType : public eprosima::fastdds::dds::TopicDataType #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - MD5 m_md5; - unsigned char* m_keyBuffer; - }; #endif // _FAST_DDS_GENERATED_HELLOWORLD_PUBSUBTYPES_H_ diff --git a/fastdds_python_examples/HelloWorldExample/HelloWorldPubSubTypes.i b/fastdds_python_examples/HelloWorldExample/HelloWorldPubSubTypes.i index cac4f8c3..36660df4 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 fastddsgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ %import(module="fastdds") "fastdds/dds/topic/TopicDataType.hpp"; diff --git a/fastdds_python_examples/HelloWorldExample/HelloWorldv1.cxx b/fastdds_python_examples/HelloWorldExample/HelloWorldv1.cxx index 90e82ea8..a0462c5f 100644 --- a/fastdds_python_examples/HelloWorldExample/HelloWorldv1.cxx +++ b/fastdds_python_examples/HelloWorldExample/HelloWorldv1.cxx @@ -16,7 +16,7 @@ * @file HelloWorld.cpp * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool fastddsgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 diff --git a/fastdds_python_examples/HelloWorldExample/HelloWorldv1.h b/fastdds_python_examples/HelloWorldExample/HelloWorldv1.h index 9f6f726e..00a28f8b 100644 --- a/fastdds_python_examples/HelloWorldExample/HelloWorldv1.h +++ b/fastdds_python_examples/HelloWorldExample/HelloWorldv1.h @@ -16,7 +16,7 @@ * @file HelloWorld.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool fastddsgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #include From e0c0021bc1851c50390bcb05c1ddb62e7e7bbddd Mon Sep 17 00:00:00 2001 From: Emilio Cuesta Date: Mon, 9 Feb 2026 14:14:09 +0100 Subject: [PATCH 17/17] Bump to version 1.4.4 Signed-off-by: Emilio Cuesta --- fastdds_python/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fastdds_python/CMakeLists.txt b/fastdds_python/CMakeLists.txt index a622261a..e60ad6df 100644 --- a/fastdds_python/CMakeLists.txt +++ b/fastdds_python/CMakeLists.txt @@ -24,7 +24,7 @@ if(POLICY CMP0086) cmake_policy(SET CMP0086 NEW) endif() -project(fastdds_python VERSION 1.4.3) +project(fastdds_python VERSION 1.4.4) # Set BUILD_TESTING to OFF by default. if(NOT BUILD_TESTING)